コード例 #1
0
        public async Task <IActionResult> Get([FromQuery] SearchPlayerSummariesQuery query)
        {
            if (query == null)
            {
                query = new SearchPlayerSummariesQuery();
            }
            var results = await _queryExecutor.ExecuteAsync(query);

            return(_apiResponseHelper.SimpleQueryResponse(this, results));
        }
コード例 #2
0
        public async Task <PagedQueryResult <PlayerSummary> > ExecuteAsync(SearchPlayerSummariesQuery query, IExecutionContext executionContext)
        {
            var customEntityQuery = new SearchCustomEntityRenderSummariesQuery();

            customEntityQuery.CustomEntityDefinitionCode = PlayerCustomEntityDefinition.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(MapPlayers(catCustomEntities, allMainImages, allLikeCounts));
        }