public IntegratedPipelineBlueprint(
     OwinAppContext appContext,
     IntegratedPipelineBlueprintStage firstStage,
     string pathBase)
 {
     _appContext = appContext;
     _firstStage = firstStage;
     _pathBase   = pathBase;
 }
示例#2
0
 public AspNetEnvironmentTests()
 {
     var appContext = new OwinAppContext();
     appContext.Initialize(_ => { });
     var requestContext = new RequestContext(new FakeHttpContextEx(), new RouteData());
     OwinCallContext callContext = appContext.CreateCallContext(requestContext, string.Empty, string.Empty, null, null);
     callContext.Execute();
     _env = _aspNetDictionary = callContext.Environment;
 }
 public IntegratedPipelineBlueprint(
     OwinAppContext appContext,
     IntegratedPipelineBlueprintStage firstStage,
     string pathBase)
 {
     _appContext = appContext;
     _firstStage = firstStage;
     _pathBase = pathBase;
 }
示例#4
0
        public AspNetEnvironmentTests()
        {
            var appContext = new OwinAppContext();

            appContext.Initialize(_ => { });
            var             requestContext = new RequestContext(new FakeHttpContextEx(), new RouteData());
            OwinCallContext callContext    = appContext.CreateCallContext(requestContext, string.Empty, string.Empty, null, null);

            callContext.Execute();
            _env = _aspNetDictionary = callContext.Environment;
        }
示例#5
0
        /// <summary>
        /// Registers a route for a specific OWIN application entry point.
        /// </summary>
        /// <typeparam name="TApp">The OWIN application entry point type.</typeparam>
        /// <param name="routes">The route collection.</param>
        /// <param name="name">The given name of the route.</param>
        /// <param name="pathBase">The route path to map to the given OWIN application.</param>
        /// <param name="app">The OWIN application entry point.</param>
        /// <returns>The created route.</returns>
        public static RouteBase MapOwinPath <TApp>(this RouteCollection routes, string name, string pathBase, TApp app)
        {
            if (app == null)
            {
                throw new ArgumentNullException("app");
            }

            OwinAppContext appDelegate = OwinBuilder.Build(builder => builder.Use(new Func <object, object>(_ => app)));

            return(Add(routes, name, new OwinRoute(pathBase, () => appDelegate)));
        }
        /// <summary>
        /// Registers a route for a specific OWIN application entry point.
        /// </summary>
        /// <typeparam name="TApp">The OWIN application entry point type.</typeparam>
        /// <param name="routes">The route collection.</param>
        /// <param name="name">The given name of the route.</param>
        /// <param name="pathBase">The route path to map to the given OWIN application.</param>
        /// <param name="app">The OWIN application entry point.</param>
        /// <returns>The created route.</returns>
        public static RouteBase MapOwinPath <TApp>(this RouteCollection routes, string name, string pathBase, TApp app)
        {
            OwinAppContext appDelegate = OwinBuilder.Build(builder => builder.Use(new Func <object, object>(_ => app)));

            return(Add(routes, name, new OwinRoute(pathBase, () => appDelegate)));
        }
        /// <summary>
        /// Invokes the System.Action startup delegate to build the OWIN application
        /// and then registers a route for it on the given path.
        /// </summary>
        /// <param name="routes">The route collection.</param>
        /// <param name="pathBase">The route path to map to the given OWIN application.</param>
        /// <param name="startup">A System.Action delegate invoked to build the OWIN application.</param>
        /// <returns>The created route.</returns>
        public static RouteBase MapOwinPath(this RouteCollection routes, string pathBase, Action <IAppBuilder> startup)
        {
            OwinAppContext appDelegate = OwinBuilder.Build(startup);

            return(Add(routes, null, new OwinRoute(pathBase, () => appDelegate)));
        }