Example #1
0
        private IntegratedPipelineBlueprint InitializeBlueprint()
        {
            IntegratedPipelineBlueprintStage firstStage = null;

            string appStartup            = ConfigurationManager.AppSettings[Constants.OwinAppStartup];
            var    loader                = new DefaultLoader();
            Action <IAppBuilder> startup = loader.Load(appStartup ?? string.Empty);

            if (startup == null)
            {
                return(null);
            }

            var appContext = OwinBuilder.Build(builder =>
            {
                EnableIntegratedPipeline(builder, stage => firstStage = stage);
                startup.Invoke(builder);
            });

            if (appContext == null)
            {
                return(null);
            }

            string basePath = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);

            return(new IntegratedPipelineBlueprint(appContext, firstStage, basePath));
        }
Example #2
0
        /// <summary>
        /// Initialize an OwinRouteHandler
        /// </summary>
        /// <param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
        public OwinRouteHandler(Action <IAppBuilder> startup)
        {
            _pathBase = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);

            OwinAppContext app         = null;
            bool           initialized = false;
            var            syncLock    = new object();

            _appAccessor = () => LazyInitializer.EnsureInitialized(
                ref app,
                ref initialized,
                ref syncLock,
                () => OwinBuilder.Build(startup));
        }
Example #3
0
        private IntegratedPipelineBlueprint InitializeBlueprint()
        {
            IntegratedPipelineBlueprintStage firstStage = null;

            Action <IAppBuilder> startup    = OwinBuilder.GetAppStartup();
            OwinAppContext       appContext = OwinBuilder.Build(builder =>
            {
                EnableIntegratedPipeline(builder, stage => firstStage = stage);
                startup.Invoke(builder);
            });

            string basePath = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);

            return(new IntegratedPipelineBlueprint(appContext, firstStage, basePath));
        }
Example #4
0
 /// <summary>
 /// Initialize an OwinRouteHandler
 /// </summary>
 /// <param name="startup">The method to initialize the pipeline that processes requests for the route.</param>
 public OwinRouteHandler(Action <IAppBuilder> startup)
 {
     _pathBase    = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);
     _appAccessor = () => OwinBuilder.Build(startup);
 }