Exemplo n.º 1
0
 public IEnumerable <Color> GetAll(Expression <Func <Color, bool> > filter = null)
 {
     using (RecapProjectContext context = new RecapProjectContext())
     {
         return(filter == null?context.Set <Color>().ToList() : context.Set <Color>().Where(filter).ToList());
     }
 }
Exemplo n.º 2
0
 public Color Get(Expression <Func <Color, bool> > filter)
 {
     using (RecapProjectContext context = new RecapProjectContext())
     {
         return(context.Set <Color>().Where(filter).FirstOrDefault());
     }
 }
Exemplo n.º 3
0
 public IEnumerable <Car> GetAllByColorId(Expression <Func <Car, bool> > filter)
 {
     using (RecapProjectContext context = new RecapProjectContext())
     {
         return(context.Set <Car>().Where(filter).ToList());
     }
 }