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()); } }
public Color Get(Expression <Func <Color, bool> > filter) { using (RecapProjectContext context = new RecapProjectContext()) { return(context.Set <Color>().Where(filter).FirstOrDefault()); } }
public IEnumerable <Car> GetAllByColorId(Expression <Func <Car, bool> > filter) { using (RecapProjectContext context = new RecapProjectContext()) { return(context.Set <Car>().Where(filter).ToList()); } }