Beispiel #1
0
 public List <Brand> GetAll(Expression <Func <Brand, bool> > filter = null)
 {
     using (ReCapDemoDatabaseContext context = new ReCapDemoDatabaseContext())
     {
         return(filter == null?context.Set <Brand>().ToList() : context.Set <Brand>().Where(filter).ToList());
     }
 }
Beispiel #2
0
 public Brand Get(Expression <Func <Brand, bool> > filter)
 {
     using (ReCapDemoDatabaseContext context = new ReCapDemoDatabaseContext())
     {
         return(context.Set <Brand>().SingleOrDefault(filter));
     }
 }