public async Task <CItemTemplate> GetItemByFiltersAsync(ItemFilterParams filterParams) { var itemTemplates = await FindAllByConditionsAsync(filterParams.AsFilters(), filterParams.FilterType, filterParams.ToCacheString()); return(itemTemplates.DefaultIfEmpty(new CItemTemplate()).FirstOrDefault()); }
public async Task <IEnumerable <CItemTemplate> > GetAllItemTemplatesAsync(ItemFilterParams filterParams) { IEnumerable <CItemTemplate> itemTemplates; if (filterParams.IsEmpty()) { itemTemplates = await FindAllAsync(); } else { itemTemplates = await FindAllByConditionsAsync(filterParams.AsFilters(), filterParams.FilterType, filterParams.ToCacheString()); } return(itemTemplates.OrderItemTemplates(filterParams.SortOrder)); }