Exemplo n.º 1
0
        public IHttpRouteFunctionBuilder HttpRoute(string routePrefix, Action <IHttpFunctionBuilder> httpFunctionBuilder)
        {
            string rootedRoutePrefix = routePrefix.StartsWith("/") ? routePrefix : string.Concat("/", routePrefix);
            HttpRouteConfiguration routeConfiguration = new HttpRouteConfiguration()
            {
                Route = rootedRoutePrefix,
            };
            HttpFunctionBuilder builder = new HttpFunctionBuilder(routeConfiguration, _definitions);

            httpFunctionBuilder(builder);

            return(new HttpRouteFunctionBuilder(this, routeConfiguration));
        }
Exemplo n.º 2
0
        public IHttpRouteFunctionBuilder HttpRoute(string routePrefix, Action <IHttpFunctionBuilder> httpFunctionBuilder)
        {
            string rootedRoutePrefix = routePrefix == null ? null : routePrefix.StartsWith("/") ? routePrefix : string.Concat("/", routePrefix);
            HttpRouteConfiguration routeConfiguration = new HttpRouteConfiguration()
            {
                ClaimsPrincipalAuthorizationType = null,
                Route = rootedRoutePrefix,
            };
            HttpFunctionBuilder builder = new HttpFunctionBuilder(_connectionStringSettingNames, routeConfiguration, _definitions);

            httpFunctionBuilder(builder);

            return(new HttpRouteFunctionBuilder(this, routeConfiguration));
        }
Exemplo n.º 3
0
        public IHttpRouteFunctionBuilder HttpRoute <TAuthorizationType>(string routePrefix,
                                                                        Action <IHttpFunctionBuilder> httpFunctionBuilder) where TAuthorizationType : IClaimsPrincipalAuthorization
        {
            string rootedRoutePrefix = routePrefix.StartsWith("/") ? routePrefix : string.Concat("/", routePrefix);
            HttpRouteConfiguration routeConfiguration = new HttpRouteConfiguration()
            {
                ClaimsPrincipalAuthorizationType = typeof(TAuthorizationType),
                Route = rootedRoutePrefix,
            };
            HttpFunctionBuilder builder = new HttpFunctionBuilder(routeConfiguration, _definitions);

            httpFunctionBuilder(builder);

            return(new HttpRouteFunctionBuilder(this, routeConfiguration));
        }