Beispiel #1
0
 public async Task <List <T> > GetList <T>(Expression <Func <T, bool> > filter = null) where T : class, IEntity, new()
 {
     using (var context = new WebInfoContext())
     {
         return(filter == null ? await context.Set <T>().ToListAsync() : await context.Set <T>().Where(filter).ToListAsync());
     }
 }
Beispiel #2
0
 public async Task <List <T> > GetList <T>() where T : class, IEntity, new()
 {
     using (var context = new WebInfoContext())
     {
         return(await context.Set <T>().ToListAsync());
     }
 }