コード例 #1
0
        public async Task <CItemTemplate> GetItemByFiltersAsync(ItemFilterParams filterParams)
        {
            var itemTemplates = await FindAllByConditionsAsync(filterParams.AsFilters(), filterParams.FilterType, filterParams.ToCacheString());

            return(itemTemplates.DefaultIfEmpty(new CItemTemplate()).FirstOrDefault());
        }
コード例 #2
0
        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));
        }