Exemplo n.º 1
0
 public List <Car> GetAll(Expression <Func <Car, bool> > filter = null)
 {
     using (ReCapDBContext context = new ReCapDBContext())
     {
         return(filter == null?context.Set <Car>().ToList() : context.Set <Car>().Where(filter).ToList());
     }
 }
Exemplo n.º 2
0
 public Car Get(Expression <Func <Car, bool> > filter)
 {
     using (ReCapDBContext context = new ReCapDBContext())
     {
         return(context.Set <Car>().SingleOrDefault(filter));
     }
 }