示例#1
0
 public TEntity Get(int id)
 {
     // Here we are working with a DbContext, not PlutoContext. So we don't have DbSets
     // such as Courses or Authors, and we need to use the generic Set() method to access them.
     return(Context.Set <TEntity>().Find(id));
 }
示例#2
0
 public GenericRepository(StoreDBContext _dbContext)
 {
     dbContext = _dbContext;
     dbSet     = dbContext.Set <T>();
 }
示例#3
0
 public StoreBaseRepository()
 {
     //Get the specific set of the Required Table
     dbSet = context.Set <T>();
 }