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())); }
public IContentRepositoryQueryContext <ICollection <ICustomEntityRoutingRule> > AsRoutingRules() { var query = new GetAllCustomEntityRoutingRulesQuery(); return(ContentRepositoryQueryContextFactory.Create(query, ExtendableContentRepository)); }
public Task <ICollection <ICustomEntityRoutingRule> > GetAllCustomEntityRoutingRulesAsync(IExecutionContext executionContext = null) { var query = new GetAllCustomEntityRoutingRulesQuery(); return(_queryExecutor.ExecuteAsync(query, executionContext)); }
public Task <ICollection <ICustomEntityRoutingRule> > AsRoutingRulesAsync() { var query = new GetAllCustomEntityRoutingRulesQuery(); return(ExtendableContentRepository.ExecuteQueryAsync(query)); }