当前位置: 首页>>代码示例>>C#>>正文


C# IApplicationBuilder.UseOwin方法代码示例

本文整理汇总了C#中IApplicationBuilder.UseOwin方法的典型用法代码示例。如果您正苦于以下问题:C# IApplicationBuilder.UseOwin方法的具体用法?C# IApplicationBuilder.UseOwin怎么用?C# IApplicationBuilder.UseOwin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IApplicationBuilder的用法示例。


在下文中一共展示了IApplicationBuilder.UseOwin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseOwin(addToPiepline =>
            {
                addToPiepline(next =>
                {
                    return async env =>
                    {
                        var accept = env["websocket.Accept"] as WebSocketAccept;
                        if (accept == null)
                        {
                            // Not a websocket request
                            await next(env);
                        }
                        else
                        {
                            accept(null, WebSocketEcho);
                        }
                    };
                });
            });

            app.Run(async context =>
            {
                context.Response.ContentType = "text/plain";
                await context.Response.WriteAsync("Not a WebSocket");
            });
        }
开发者ID:transformersprimeabcxyz,项目名称:_TO-DO-Entropy-aspnet,代码行数:28,代码来源:Startup.cs

示例2: Configure

 public void Configure(IApplicationBuilder app)
 {
     app.UseOwin(x =>
     x.UseNancy(opt => 
         opt.Bootstrapper = new NancyBootstrapper(Config)));
     Console.WriteLine("Nancy now listening - " + "" + ". Press ctrl-c to stop");
 }
开发者ID:iancooper,项目名称:Paramore,代码行数:7,代码来源:Startup.cs

示例3: Configure

 public void Configure(IApplicationBuilder app)
 {
     app.UseOwin(pipeline =>
     {
         pipeline(next => OwinHello);
     });
 }
开发者ID:ColinDabritz,项目名称:Docs,代码行数:7,代码来源:Startup.cs

示例4: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseStaticFiles();
            app.UseStatusCodePages();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action}/{id?}",
                    defaults: new {controller = "Home", action = "Index"});
            });

            app.UseOwin(addToPipeline =>
            {
                addToPipeline(next =>
                {
                    var builder = new AppBuilder();
                    var hubConfig = new HubConfiguration { EnableDetailedErrors = true };

                    builder.MapSignalR(hubConfig);

                    var appFunc = builder.Build(typeof(Func<IDictionary<string, object>, Task>)) as Func<IDictionary<string, object>, Task>;

                    return appFunc;
                });
            });
        }
开发者ID:swanitzek,项目名称:ASP5-MVC6-SignalR2,代码行数:28,代码来源:Startup.cs

示例5: Configure

 public void Configure(IApplicationBuilder app)
 {
     // Make Nancy use bootstrapper with pre-built container.
     app.UseOwin(owin =>
         owin.UseNancy(options =>
             options.Bootstrapper = new Bootstrapper(Container)));
 }
开发者ID:nathanchere,项目名称:Nancy.Autofac.Dnx,代码行数:7,代码来源:Startup.cs

示例6: Configure

 public void Configure(IApplicationBuilder app)
 {
   app.Use( (ctx,next) => {
     WriteLine($"[{ctx.Request.Method}] {ctx.Request.Path}");
     return next();
   });
   app.UseOwin(x => x.UseNancy());
 }
开发者ID:Hettomei,项目名称:extreme-carpaccio,代码行数:8,代码来源:startup.cs

示例7: Configure

        public void Configure(IApplicationBuilder app)
        {
            
            var config = this.Configuration;
            var appConfig = new AppConfiguration();
            ConfigurationBinder.Bind(config, appConfig);

            app.UseOwin(x => x.UseNancy(opt => opt.Bootstrapper = new DemoBootstrapper(appConfig)));
        }
开发者ID:RadifMasud,项目名称:Nancy,代码行数:9,代码来源:Startup.cs

示例8: Configure

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app)
        {
            app.UseIISPlatformHandler();

            app.UseOwin(pipeline =>
            {
                pipeline.UseNancy(options => options.Bootstrapper = new MyNancyBootstrapper());
            });
        }
开发者ID:dcomartin,项目名称:AspNet5NancyDemo,代码行数:10,代码来源:Startup.cs

示例9: Configure

 public void Configure(IApplicationBuilder app)
 {
     app.UseOwin(addToPiepline =>
     {
         addToPiepline(next =>
         {
             return Invoke;
         });
     });
 }
开发者ID:leloulight,项目名称:Entropy,代码行数:10,代码来源:Startup.cs

示例10: Configure

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseOwin(x => x.UseNancy());
        }
开发者ID:yahehe,项目名称:Nancy.Swagger,代码行数:12,代码来源:Startup.cs

示例11: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.Use((context, next) =>
                {
                    context.Response.Headers.Add("Access-Control-Allow-Origin", new[] { "*" });
                    context.Response.Headers.Add("Access-Control-Allow-Headers", new[] { "*" });
                    context.Response.Headers.Add("Access-Control-Allow-Methods", new[] { "*" });
                    return next();
                });

            app.UseOwin(x => x.UseNancy());
        }
开发者ID:CrshOverride,项目名称:ember-web-api-backend,代码行数:12,代码来源:Startup.cs

示例12: Configure

 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
 public void Configure(IApplicationBuilder app)
 {
     app.UseIISPlatformHandler();
     app.UseOwin(buildFunc =>
     {
         buildFunc(next => env =>
         {
             System.Console.WriteLine("Got Request");
             return next(env);
         });
         buildFunc.UseNancy(options => options.Bootstrapper = new MyNancyBootstrapper());
     });
 }
开发者ID:rinckd,项目名称:angular2,代码行数:14,代码来源:Startup.cs

示例13: Configure

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app)
        {
            var runtime = new Runtime();
            runtime.RegisterResource(new FooResource());
            app.UseOwin(builder => builder.UseTurquoise(runtime));
            //app.UseServer();
            
            // app.UseIISPlatformHandler();

            // app.Run(async (context) =>
            // {
            //     await context.Response.WriteAsync("Hello World!");
            // });
        }
开发者ID:DaveyWood,项目名称:turquoise,代码行数:15,代码来源:Startup.cs

示例14: Configure

        // Configure is called after ConfigureServices is called.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.UseOwin(addToPiepline =>
            {
                addToPiepline(next =>
                {
                    var middleware = new DebugMiddleware(next);
                    return middleware.Invoke;
                });
            });

            // Configure the HTTP request pipeline.
            app.UseStaticFiles();


            // Add MVC to the request pipeline.
            app.UseMvc();
            // Add the following route for porting Web API 2 controllers.
            // routes.MapWebApiRoute("DefaultApi", "api/{controller}/{id?}");
        }
开发者ID:joelgasso,项目名称:blogcodes,代码行数:21,代码来源:Startup.cs

示例15: Configure

        public void Configure(IApplicationBuilder app)
        {
            var factory = app.ApplicationServices.GetRequiredService<ILoggerFactory>();
            factory.AddConsole();

            app.UseCookieAuthentication(options => {
                options.AutomaticAuthentication = true;
                options.AuthenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.LoginPath = new PathString("/signin");
            });

            app.UseTwitterAuthentication( configureOptions =>
            {
                configureOptions.ConsumerKey = TWITTERCONSUMERKEY;
                configureOptions.ConsumerSecret = TWITTERSECRET;
                configureOptions.AutomaticAuthentication = true;
                configureOptions.AuthenticationScheme = "Twitter";
            });

            app.UseOwin(x => x.UseNancy());
        }
开发者ID:jchannon,项目名称:aspnet5nancybridge,代码行数:21,代码来源:Startup.cs


注:本文中的IApplicationBuilder.UseOwin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。