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