通用存储库 [英] generic repositories

查看:54
本文介绍了通用存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家下午 每个人,我
使用 实体 框架 4.3和
我正在创建 泛型 存储库
例如 已执行
一些例程

Good afternoon everybody, I'm working with entity framework 4.3 and I'm creating generic repositories, for example have already performed some routines.

        public void Salvar(T entity)

        {

            Adicionar(实体);

            pentities.SaveChanges();

        }

        public void Salvar(T entity)
        {
            Adicionar(entity);
            pentities.SaveChanges();
        }

         public T PesquisarPorCodigo(int intCodigo)

        {

           返回pentities.Set< T>()。查找(intCodigo);

        }

         public T PesquisarPorCodigo(int intCodigo)
        {
            return pentities.Set<T>().Find(intCodigo);
        }

例程
返回 实体的下一个 代码

How would the routine to return the next code of an entity?

谢谢。

Thank you.

< span id ="x_result_box"lang ="en">

推荐答案

Hi Lute div,

Hi Lute div,

欢迎来到MSDN论坛。

Welcome to MSDN Forum.

您能澄清一下下一个代码是什么吗?

Could you please clarify what's the next code is?

最好的问候


这篇关于通用存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆