Exemplo n.º 1
0
        public Task <ICollection <ICustomEntityRoutingRule> > ExecuteAsync(GetAllCustomEntityRoutingRulesQuery query, IExecutionContext executionContext)
        {
            var duplicateRule = _customEntityRoutingRules
                                .GroupBy(r => r.RouteFormat)
                                .FirstOrDefault(g => g.Count() > 1);

            if (duplicateRule != null)
            {
                throw new Exception("Multiple handlers cannot exist using the same RouteFormat. Duplicate: " + duplicateRule.Key);
            }

            return(Task.FromResult <ICollection <ICustomEntityRoutingRule> >(_customEntityRoutingRules.ToList()));
        }
Exemplo n.º 2
0
        public IContentRepositoryQueryContext <ICollection <ICustomEntityRoutingRule> > AsRoutingRules()
        {
            var query = new GetAllCustomEntityRoutingRulesQuery();

            return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository));
        }
Exemplo n.º 3
0
        public Task <ICollection <ICustomEntityRoutingRule> > GetAllCustomEntityRoutingRulesAsync(IExecutionContext executionContext = null)
        {
            var query = new GetAllCustomEntityRoutingRulesQuery();

            return(_queryExecutor.ExecuteAsync(query, executionContext));
        }
Exemplo n.º 4
0
        public Task <ICollection <ICustomEntityRoutingRule> > AsRoutingRulesAsync()
        {
            var query = new GetAllCustomEntityRoutingRulesQuery();

            return(ExtendableContentRepository.ExecuteQueryAsync(query));
        }