public Task <IPagedList <Setting> > GetPagedListAsync(ListBasicQueryInput input) { var query = Repository.GetQueryable(); query = query.WhereIf(t => t.Key.Contains(input.SearchTerm), () => input.SearchTerm != null); return(query.OrderBy(t => t.Key).ToPagedListAsync(input)); }
public Task <IPagedList <Page> > GetPagesPagedListAsync(ListBasicQueryInput input) { var query = Repository.GetQueryable() .OrderBy(t => t.DisplayOrder) .ThenByDescending(t => t.CreationTime) .WhereIf(t => t.Title.Contains(input.SearchTerm), () => !string.IsNullOrWhiteSpace(input.SearchTerm)); return(query.ToPagedListAsync(input)); }