public async Task <JsonResult> Get([FromQuery] SearchCatSummariesQuery query)
    {
        if (query == null)
        {
            query = new SearchCatSummariesQuery();
        }

        return(await _apiResponseHelper.RunQueryAsync(query));
    }
        public async Task <IActionResult> Get([FromQuery] SearchCatSummariesQuery query)
        {
            if (query == null)
            {
                query = new SearchCatSummariesQuery();
            }
            var results = await _queryExecutor.ExecuteAsync(query);

            return(_apiResponseHelper.SimpleQueryResponse(this, results));
        }
Beispiel #3
0
        public async Task <JsonResult> Get([FromQuery] SearchCatSummariesQuery query)
        {
            if (query == null)
            {
                query = new SearchCatSummariesQuery();
            }
            var results = await _domainRepository.ExecuteQueryAsync(query);

            return(_apiResponseHelper.SimpleQueryResponse(results));
        }
        public async Task <PagedQueryResult <CatSummary> > ExecuteAsync(SearchCatSummariesQuery query, IExecutionContext executionContext)
        {
            var customEntityQuery = new SearchCustomEntityRenderSummariesQuery();

            customEntityQuery.CustomEntityDefinitionCode = CatCustomEntityDefinition.DefinitionCode;
            customEntityQuery.PageSize      = query.PageSize = query.PageSize;
            customEntityQuery.PageNumber    = query.PageNumber;
            customEntityQuery.PublishStatus = PublishStatusQuery.Published;
            customEntityQuery.SortBy        = CustomEntityQuerySortType.PublishDate;

            var catCustomEntities = await _customEntityRepository.SearchCustomEntityRenderSummariesAsync(customEntityQuery);

            var allMainImages = await GetMainImages(catCustomEntities);

            var allLikeCounts = await GetLikeCounts(catCustomEntities);

            return(MapCats(catCustomEntities, allMainImages, allLikeCounts));
        }