コード例 #1
0
 public T GetById(Int32 id)
 {
     return(context.Set <T>()
            .Where(e => e.Id == id)
            .FirstOrDefault());
 }
コード例 #2
0
 public GenericRepository(CMContext context)
 {
     Context = context;
     DbSet   = Context.Set <TEntity>();
 }