public async Task <PagedQueryResult <CustomEntityRenderSummary> > ExecuteAsync(SearchCustomEntityRenderSummariesQuery query, IExecutionContext executionContext) { var dbPagedResult = await GetQueryAsync(query, executionContext); var results = await _customEntityRenderSummaryMapper.MapAsync(dbPagedResult.Items, executionContext); return(dbPagedResult.ChangeType(results)); }
public async Task <ICollection <CustomEntityRenderSummary> > ExecuteAsync(GetCustomEntityRenderSummariesByDefinitionCodeQuery query, IExecutionContext executionContext) { var dbResults = await QueryAsync(query, executionContext); var results = await _customEntityRenderSummaryMapper.MapAsync(dbResults, executionContext); return(results); }
public async Task <IDictionary <int, CustomEntityRenderSummary> > ExecuteAsync(GetCustomEntityRenderSummariesByIdRangeQuery query, IExecutionContext executionContext) { var dbResults = await QueryAsync(query, executionContext); EnforcePermissions(dbResults, executionContext); var results = await _customEntityRenderSummaryMapper.MapAsync(dbResults, executionContext); return(results.ToDictionary(r => r.CustomEntityId)); }
public async Task <CustomEntityRenderSummary> ExecuteAsync(GetCustomEntityRenderSummaryByIdQuery query, IExecutionContext executionContext) { var dbResult = await QueryAsync(query, executionContext); if (dbResult == null) { return(null); } await _permissionValidationService.EnforceCustomEntityPermissionAsync <CustomEntityReadPermission>(dbResult.CustomEntity.CustomEntityDefinitionCode); var result = await _customEntityRenderSummaryMapper.MapAsync(dbResult, executionContext); return(result); }
public async Task <ICollection <CustomEntityRenderSummary> > ExecuteAsync(GetCustomEntityRenderSummariesByUrlSlugQuery query, IExecutionContext executionContext) { var dbResult = await _dbContext .CustomEntityPublishStatusQueries .AsNoTracking() .FilterActive() .FilterByCustomEntityDefinitionCode(query.CustomEntityDefinitionCode) .FilterByCustomEntityUrlSlug(query.UrlSlug) .FilterByStatus(query.PublishStatus, executionContext.ExecutionDate) .Select(e => e.CustomEntityVersion) .Include(e => e.CustomEntity) .ToListAsync(); if (!dbResult.Any()) { return(Array.Empty <CustomEntityRenderSummary>()); } var result = await _customEntityRenderSummaryMapper.MapAsync(dbResult, executionContext); return(result); }