Exemplo n.º 1
0
        public async Task <Dictionary <int, Feature> > ExecuteAsync(GetFeaturesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var customEntityQuery = new GetCustomEntityRenderSummariesByIdRangeQuery(query.FeatureIds);
            var customEntities    = await _customEntityRepository.GetCustomEntityRenderSummariesByIdRangeAsync(customEntityQuery);;

            var features = customEntities
                           .Select(d => MapFeature(d.Value))
                           .ToDictionary(f => f.FeatureId);

            return(features);
        }
Exemplo n.º 2
0
        public async Task <IDictionary <int, Feature> > ExecuteAsync(GetFeaturesByIdRangeQuery query, IExecutionContext executionContext)
        {
            var features = await _contentRepository
                           .CustomEntities()
                           .GetByIdRange(query.FeatureIds)
                           .AsRenderSummaries()
                           .MapItem(MapFeature)
                           .ExecuteAsync();

            return(features);
        }
Exemplo n.º 3
0
        private async Task <ICollection <Feature> > GetFeaturesAsync(ICollection <int> featureIds)
        {
            if (EnumerableHelper.IsNullOrEmpty(featureIds))
            {
                return(Array.Empty <Feature>());
            }
            var query = new GetFeaturesByIdRangeQuery(featureIds);

            var features = await _queryExecutor.ExecuteAsync(query);

            return(features
                   .Select(f => f.Value)
                   .OrderBy(f => f.Title)
                   .ToList());
        }