public ContentRouteCreator(ILogger <ContentRouteCreator> logger, EndpointDataSource endpointDataSource, IContentTypeProvider contentTypeProvider, IContentTypeExpander contentTypeExpander)
 {
     Logger              = logger;
     EndpointDataSource  = endpointDataSource;
     ContentTypeProvider = contentTypeProvider;
     ContentTypeExpander = contentTypeExpander;
 }
        public ContentRouteConstraint(IContentRouter contentRouter, IContentTypeExpander contentTypeExpander, string contentTypeorGroupIdOrTypeName = null)
        {
            ContentRouter       = contentRouter;
            ContentTypeExpander = contentTypeExpander;

            Types = contentTypeorGroupIdOrTypeName != null?ContentTypeExpander.Expand(contentTypeorGroupIdOrTypeName) : Enumerable.Empty <ContentTypeDescriptor>();

            if (Types == null)
            {
                throw new Exception($"Routing could not use the constraint :contentroute({contentTypeorGroupIdOrTypeName}) because it did not resolve to a content type or group or type name");
            }
        }