本文整理汇总了C#中IBuilder.UseBrowserLink方法的典型用法代码示例。如果您正苦于以下问题:C# IBuilder.UseBrowserLink方法的具体用法?C# IBuilder.UseBrowserLink怎么用?C# IBuilder.UseBrowserLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBuilder
的用法示例。
在下文中一共展示了IBuilder.UseBrowserLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Configure
public void Configure(IBuilder app)
{
// Setup configuration sources
var configuration = new Configuration();
configuration.AddEnvironmentVariables();
// Set up application services
app.UseServices(services =>
{
// Add MVC services to the services container
services.AddMvc();
});
// Enable Browser Link support
app.UseBrowserLink();
// Add static files to the request pipeline
app.UseStaticFiles();
// Add MVC to the request pipeline
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}",
defaults: new { controller = "Home", action = "Index" });
});
}
示例2: Configure
public void Configure(IBuilder app)
{
// Enable Browser Link support
app.UseBrowserLink();
// 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
services.AddEntityFramework()
.AddSqlServer();
// Configure DbContext
services.SetupOptions<DbContextOptions>(options =>
{
options.UseSqlServer(configuration.Get("Data:DefaultConnection:ConnectionString"));
});
// Add Identity services to the services container
services.AddIdentity<ApplicationUser>()
.AddEntityFramework<ApplicationUser, ApplicationDbContext>()
.AddHttpSignIn();
// Add MVC services to the services container
services.AddMvc();
});
// Add static files to the request pipeline
app.UseStaticFiles();
// Add cookie-based authentication to the request pipeline
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
});
// Add MVC to the request pipeline
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}",
defaults: new { controller = "Home", action = "Index" });
routes.MapRoute(
name: "api",
template: "{controller}/{id?}");
});
}
示例3: Configure
public void Configure(IBuilder app)
{
// Enable Browser Link support
app.UseBrowserLink();
// Setup configuration sources
var configuration = new Configuration();
//configuration.AddIniFile("config.ini");
configuration.AddJsonFile("config.json");
configuration.AddEnvironmentVariables();
//app.Run(async context =>
//{
// await context.Response.WriteAsync(configuration.Get("Data:Configuration"));
//});
app.Run(async context =>
{
var asm = Assembly.Load(new AssemblyName("klr.host"));
var assemblyVersion = asm.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
await context.Response.WriteAsync(assemblyVersion.InformationalVersion);
});
// Set up application services
app.UseServices(services =>
{
// Add EF services to the services container
services.AddEntityFramework().AddInMemoryStore();
services.AddScoped<PersonContext>();
// Add MVC services to the services container
services.AddMvc();
});
// Add static files to the request pipeline
app.UseStaticFiles();
// Add MVC to the request pipeline
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}",
defaults: new { controller = "Home", action = "Index" });
routes.MapRoute(
name: "api",
template: "{controller}/{id?}");
});
}