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


C# IApplicationBuilder.ConfigureRoutes方法代码示例

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


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

示例1: Configure

        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            // Add static files to the request pipeline
            app.UseStaticFiles();

            // Add cookie-based authentication to the request pipeline
            app.UseIdentity();

            // Add the following to the request pipeline only in development environment.
            if (env.IsEnvironment("Development"))
            {
                app.UseBrowserLink();
            }
            /* Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline.
             * Note: ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production.
             */
            app.UseErrorPage(ErrorPageOptions.ShowAll);

            app.ConfigureSecurity();

            //Configure SignalR
            app.UseSignalR();

            // Add MVC to the request pipeline
            app.ConfigureRoutes();

            MyShuttleDataInitializer.InitializeDatabaseAsync(app.ApplicationServices).Wait();

        }
开发者ID:EmiiFont,项目名称:MyShuttle_RC,代码行数:29,代码来源:Startup.cs

示例2: Configure

        public void Configure(IApplicationBuilder app)
        {
            // Setup configuration sources
            var configuration = new Configuration();
            configuration.AddJsonFile("config.json");
            configuration.AddEnvironmentVariables();

            // Set up application services
            app.UseServices(services =>
            {
                // Add EF services to the services container and configure DbContext
                services.ConfigureDataContext(configuration);

                // Register MyShuttle dependencies
                services.ConfigureDependencies();


                //Add Identity services to the services container
                services.AddDefaultIdentity<MyShuttleContext, ApplicationUser, IdentityRole>(configuration);
                services.ConfigureCookieAuthentication(options =>
                {
                    options.LoginPath = new Microsoft.AspNet.Http.PathString("/Carrier/Login");
                });


                // Add MVC services to the services container
                services.AddMvc();

                services
                    .AddSignalR(options =>
                    {
                        options.Hubs.EnableDetailedErrors = true;
                    });
            });

            // Enable Browser Link support
            app.UseBrowserLink();

            /* Error page middleware displays a nice formatted HTML page for any unhandled exceptions in the request pipeline.
             * Note: ErrorPageOptions.ShowAll to be used only at development time. Not recommended for production.
             */
            app.UseErrorPage(ErrorPageOptions.ShowAll);

            // Add static files to the request pipeline
            app.UseStaticFiles();

            app.ConfigureSecurity();

            //Configure SignalR
            app.UseSignalR();

            // Add cookie-based authentication to the request pipeline

            // Add MVC to the request pipeline
            app.ConfigureRoutes();

            MyShuttleDataInitializer.InitializeDatabaseAsync(app.ApplicationServices).Wait();

        }
开发者ID:sriramdasbalaji,项目名称:My-Shuttle-Biz,代码行数:59,代码来源:Startup.cs

示例3: Configure

        public void Configure(IApplicationBuilder app)
        {
            app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear());

            app.UseStaticFiles();

            //app.UseIdentity();

            app.ConfigureRoutes();
            MyShuttleDataInitializer.InitializeDatabaseAsync(app.ApplicationServices).Wait();
        }
开发者ID:ostastny,项目名称:mvc6,代码行数:11,代码来源:Startup.cs

示例4: Configure

        // Configure is called after ConfigureServices is called.
        public async void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, MyHealthDataInitializer dataInitializer)
        {
            loggerFactory.MinimumLevel = LogLevel.Information;
            loggerFactory.AddConsole();
            loggerFactory.AddDebug();

            // Configure the HTTP request pipeline.

            // Add the following to the request pipeline only in development environment.
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage(options => options.EnableAll());
            }
            else
            {
                // Add Error handling middleware which catches all application specific errors and
                // sends the request to the following path or controller action.
                app.UseExceptionHandler("/Home/Error");
            }

            // Add the platform handler to the request pipeline.
            app.UseIISPlatformHandler();

            // Add static files to the request pipeline.
            app.UseStaticFiles();

            // Add MVC to the request pipeline.
            app.ConfigureRoutes();

            await dataInitializer.InitializeDatabaseAsync(app.ApplicationServices, Configuration);
        }
开发者ID:geekpivot,项目名称:HealthClinic.biz,代码行数:34,代码来源:Startup.cs

示例5: Configure

        // Configure is called after ConfigureServices is called.
        public async void Configure(IApplicationBuilder app, IHostingEnvironment env, 
            ILoggerFactory loggerFactory, MyHealthDataInitializer dataInitializer)
        {
            // Add Application Insights monitoring to the request pipeline as a very first middleware.
            app.UseApplicationInsightsRequestTelemetry();

            loggerFactory.MinimumLevel = LogLevel.Information;
            loggerFactory.AddConsole();

            // Add the following to the request pipeline only in development environment.
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage(options => options.EnableAll());
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            // Add Application Insights exceptions handling to the request pipeline.
            app.UseApplicationInsightsExceptionTelemetry();

            // Add static files to the request pipeline.
            app.UseStaticFiles();

            app.UseSession();

            app.ConfigureSecurity();
            
            // Add MVC to the request pipeline.
            app.ConfigureRoutes();

            app.UseIISPlatformHandler();

            await dataInitializer.InitializeDatabaseAsync(app.ApplicationServices);
        }
开发者ID:rodrigobrito,项目名称:HealthClinic.biz,代码行数:39,代码来源:Startup.cs

示例6: Configure

 public void Configure(IApplicationBuilder app)
 {
     app.ConfigureRoutes();
     app.UseStaticFiles();
     MyShuttleDataInitializer.InitializeDatabaseAsync(app.ApplicationServices).Wait();
 }
开发者ID:SychevIgor,项目名称:conferences,代码行数:6,代码来源:Startup.cs


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