public IDictionary <int, RootEntityMicroSummary> Execute(GetCustomEntityEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext) { var results = Query(query).ToDictionary(e => e.RootEntityId); EnforcePermissions(results, executionContext); return(results); }
public async Task <IDictionary <int, RootEntityMicroSummary> > ExecuteAsync(GetCustomEntityEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext) { var results = await Query(query, executionContext).ToDictionaryAsync(e => e.RootEntityId); EnforcePermissions(results, executionContext); return(results); }
private IQueryable <RootEntityMicroSummary> Query(GetCustomEntityEntityMicroSummariesByIdRangeQuery query) { var dbQuery = _dbContext .CustomEntityVersions .AsNoTracking() .FilterByActiveLocales() .FilterByWorkFlowStatusQuery(WorkFlowStatusQuery.Latest) .Where(v => query.CustomEntityIds.Contains(v.CustomEntityId)) .Select(v => new RootEntityMicroSummary() { RootEntityId = v.CustomEntityId, RootEntityTitle = v.Title, EntityDefinitionName = v.CustomEntity.CustomEntityDefinition.EntityDefinition.Name, EntityDefinitionCode = v.CustomEntity.CustomEntityDefinition.CustomEntityDefinitionCode }); return(dbQuery); }
private IQueryable <RootEntityMicroSummary> Query(GetCustomEntityEntityMicroSummariesByIdRangeQuery query, IExecutionContext executionContext) { var dbQuery = _dbContext .CustomEntityPublishStatusQueries .AsNoTracking() .FilterActive() .FilterByStatus(PublishStatusQuery.Latest, executionContext.ExecutionDate) .Where(v => query.CustomEntityIds.Contains(v.CustomEntityId)) .Select(v => new RootEntityMicroSummary() { RootEntityId = v.CustomEntityId, RootEntityTitle = v.CustomEntityVersion.Title, EntityDefinitionName = v.CustomEntity.CustomEntityDefinition.EntityDefinition.Name, EntityDefinitionCode = v.CustomEntity.CustomEntityDefinition.CustomEntityDefinitionCode }); return(dbQuery); }