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