Reacting to hosting rename

This commit is contained in:
John Luo 2016-01-17 17:56:18 -08:00
parent ae3c77b9c5
commit f08e1f9428
13 changed files with 44 additions and 44 deletions

View File

@ -29,13 +29,13 @@ namespace DatabaseErrorPageSample
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
}

View File

@ -21,13 +21,13 @@ namespace DeveloperExceptionPageSample
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
}
}

View File

@ -31,13 +31,13 @@ namespace ElmPageSample
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
}
}

View File

@ -58,13 +58,13 @@ namespace ExceptionHandlerSample
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
}
}

View File

@ -85,13 +85,13 @@ namespace MiddlewareAnaysisSample
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
public class TestDiagnosticListener

View File

@ -21,13 +21,13 @@ namespace RuntimeInfoPageSample
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
}
}

View File

@ -104,13 +104,13 @@ namespace StatusCodePagesSample
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
}
}

View File

@ -12,13 +12,13 @@ namespace WelcomePageSample
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
application.Run();
host.Run();
}
}
}

View File

@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
[Fact]
public async Task Successful_requests_pass_thru()
{
var builder = new WebApplicationBuilder().Configure(app => app
var builder = new WebHostBuilder().Configure(app => app
.UseDatabaseErrorPage()
.UseMiddleware<SuccessMiddleware>());
var server = new TestServer(builder);
@ -55,7 +55,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
[Fact]
public async Task Non_database_exceptions_pass_thru()
{
var builder = new WebApplicationBuilder().Configure(app => app
var builder = new WebHostBuilder().Configure(app => app
.UseDatabaseErrorPage()
.UseMiddleware<ExceptionMiddleware>());
var server = new TestServer(builder);
@ -255,7 +255,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
using (var database = SqlServerTestStore.CreateScratch())
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseDatabaseErrorPage(new DatabaseErrorPageOptions
@ -293,7 +293,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
{
var logProvider = new TestLoggerProvider();
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseDatabaseErrorPage();
@ -411,7 +411,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
{
using (var database = SqlServerTestStore.CreateScratch())
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseDatabaseErrorPage();

View File

@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
[Fact]
public async Task Non_migration_requests_pass_thru()
{
var builder = new WebApplicationBuilder().Configure(app => app
var builder = new WebHostBuilder().Configure(app => app
.UseMigrationsEndPoint()
.UseMiddleware<SuccessMiddleware>());
var server = new TestServer(builder);
@ -73,7 +73,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
var path = useCustomPath ? new PathString("/EndPoints/ApplyMyMigrations") : MigrationsEndPointOptions.DefaultPath;
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
if (useCustomPath)
@ -125,7 +125,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
[Fact]
public async Task Context_type_not_specified()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseMigrationsEndPoint();
@ -145,7 +145,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
[Fact]
public async Task Invalid_context_type_specified()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseMigrationsEndPoint();
@ -169,7 +169,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
[Fact]
public async Task Context_not_registered_in_services()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app => app.UseMigrationsEndPoint())
.ConfigureServices(services => services.AddEntityFramework().AddSqlServer());
var server = new TestServer(builder);
@ -196,7 +196,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity.Tests
var optionsBuilder = new DbContextOptionsBuilder();
optionsBuilder.UseSqlServer(database.ConnectionString);
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app => app.UseMigrationsEndPoint())
.ConfigureServices(services =>
{

View File

@ -489,7 +489,7 @@ namespace Microsoft.AspNet.Diagnostics
{
// Arrange
DiagnosticListener diagnosticListener = null;
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();

View File

@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Diagnostics
[InlineData(HttpStatusCode.InternalServerError)]
public async Task OnlyHandles_UnhandledExceptions(HttpStatusCode expectedStatusCode)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseExceptionHandler("/handle-errors");
@ -59,7 +59,7 @@ namespace Microsoft.AspNet.Diagnostics
[Fact]
public async Task DoesNotHandle_UnhandledExceptions_WhenResponseAlreadyStarted()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.Use(async (httpContext, next) =>
@ -108,7 +108,7 @@ namespace Microsoft.AspNet.Diagnostics
public async Task ClearsResponseBuffer_BeforeRequestIsReexecuted()
{
var expectedResponseBody = "New response body";
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
// add response buffering
@ -180,7 +180,7 @@ namespace Microsoft.AspNet.Diagnostics
{
var expiresTime = DateTime.UtcNow.AddDays(5).ToString("R");
var expectedResponseBody = "Handled error in a custom way.";
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseExceptionHandler("/handle-errors");
@ -230,7 +230,7 @@ namespace Microsoft.AspNet.Diagnostics
{
var expiresTime = DateTime.UtcNow.AddDays(10).ToString("R");
var expectedResponseBody = "Hello world!";
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseExceptionHandler("/handle-errors");
@ -280,7 +280,7 @@ namespace Microsoft.AspNet.Diagnostics
public async Task DoesNotClearCacheHeaders_WhenResponseHasAlreadyStarted()
{
var expiresTime = DateTime.UtcNow.AddDays(10).ToString("R");
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.Use(async (httpContext, next) =>
@ -350,7 +350,7 @@ namespace Microsoft.AspNet.Diagnostics
// Arrange
DiagnosticListener diagnosticListener = null;
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();

View File

@ -19,7 +19,7 @@ namespace Microsoft.AspNet.MiddlewareAnalysis
{
DiagnosticListener diagnosticListener = null;
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();