示例#1
0
 public T Get(Expression <Func <T, bool> > condition)
 {
     using (var context = new BakeshoppeInventorySystem())
     {
         var record = context.Set <T>().FirstOrDefault(condition);
         return(record);
     }
 }
示例#2
0
 public List <T> GetRange(Expression <Func <T, bool> > condition)
 {
     using (var context = new BakeshoppeInventorySystem())
     {
         var records = context.Set <T>().Where(condition).ToList();
         return(records);
     }
 }
示例#3
0
 public List <T> GetRange()
 {
     using (var context = new BakeshoppeInventorySystem())
     {
         var records = context.Set <T>().ToList();
         return(records);
     }
 }