public List <Brand> GetAll(Expression <Func <Brand, bool> > filter = null) { using (RecapContext context = new RecapContext()) { return(filter == null?context.Set <Brand>().ToList() : context.Set <Brand>().Where(filter).ToList()); } }
public Brand Get(Expression <Func <Brand, bool> > filter) { using (RecapContext context = new RecapContext()) { return(context.Set <Brand>().SingleOrDefault(filter)); } }
public Color Get(Expression <Func <Color, bool> > filter) { using (RecapContext context = new RecapContext()) { return(context.Set <Color>().SingleOrDefault(filter)); } }