Does anyone have a very complete example generic repository for EF 6.1?

后端 未结 3 1381
囚心锁ツ
囚心锁ツ 2020-12-25 08:21

I have my own repository that is as follows. However this does not take into account some of the new features such as the range features. Does anyone have a repository that

3条回答
  •  悲哀的现实
    2020-12-25 08:53

    You can add new features like this:

    public virtual void AddRange(IEnumerable entities)
    {
        DbContext.Set().AddRange(entities);
    }
    
    public virtual void RemoveRange(IEnumerable entities)
    {
        DbContext.Set().RemoveRange(entities);
    }
    

提交回复
热议问题