//Get rows that match query. protected IEnumerable <TEntity> FindEntitiesBy(QueryModel <TModel> query) { return(DbSet); }
//Get rows that match query and WHERE clause. protected IEnumerable <TEntity> FindEntitiesBy(QueryModel <TModel> query, Expression <Func <TEntity, bool> > lambda) { return(DbSet.Where(lambda).ToList()); }
public virtual IEnumerable <TModel> FindBy(QueryModel <TModel> query, Expression <Func <TEntity, bool> > lambda) { IEnumerable <TModel> results = DbSet.Where(lambda).ToList().Select(Map); return(Query(results, query)); }
public virtual IEnumerable <TModel> FindBy(QueryModel <TModel> query) { IEnumerable <TModel> results = DbSet.ToList().Select(Map); return(Query(results, query)); }
public int Count(QueryModel <TModel> query, Expression <Func <TEntity, bool> > lambda) { return(FindBy(query, lambda).Count()); }
public int Count(QueryModel <TModel> query) { return(FindBy(query).Count()); }
protected ActionResult Get <T>(Func <QueryModel <T>, SearchResults <T> > f, QueryModel <T> query = null) { var result = f(query); return(Ok(result)); }