public List <T> GetAll(Expression <Func <T, bool> > filter = null) { using (RentaCarContext context = new RentaCarContext()) { return(filter == null? context.Set <T>().ToList() : context.Set <T>().Where(filter).ToList()); } }
public T Get(Expression <Func <T, bool> > filter) { using (RentaCarContext context = new RentaCarContext()) { return(context.Set <T>().SingleOrDefault(filter)); } }
public virtual List <TModel> Get(Tsearch search) { return(_mapper.Map <List <TModel> >(_context.Set <TDatabase>().ToList())); }