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()); } }
public Color Get(Expression <Func <Color, bool> > filter) { using (RecapProjectCarContext context = new RecapProjectCarContext()) { return(context.Set <Color>().SingleOrDefault(filter)); } }