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