Remove ununsed and unneeded DbProviderFactory CreateFactory(); from IDbProviderFactoryCreator, ensure the app doesn't explode if exceptions are thrown and boot fails

This commit is contained in:
Shannon
2020-05-08 17:30:30 +10:00
parent d899e050fe
commit 12bb68100a
13 changed files with 63 additions and 55 deletions

View File

@@ -50,9 +50,7 @@ namespace Umbraco.Web.UI.BackOffice
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddUmbracoSqlCeSupport();
services.AddUmbracoSqlServerSupport();
{
services.AddUmbracoConfiguration(_config);
services.AddUmbracoCore(_env, out var factory);
services.AddUmbracoWebsite();
@@ -92,8 +90,8 @@ namespace Umbraco.Web.UI.BackOffice
public void Configure(IApplicationBuilder app)
{
// app.UseMiniProfiler();
app.UseUmbracoRequest();
//app.UseMiniProfiler();
app.UseUmbracoRequestLifetime();
if (_env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
@@ -121,13 +119,7 @@ namespace Umbraco.Web.UI.BackOffice
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller}/{action=Index}/{id?}");
endpoints.MapGet("/", async context =>
{
var profilerHtml = app.ApplicationServices.GetRequiredService<IProfilerHtml>();
await context.Response.WriteAsync($"<html><body>Hello World!{profilerHtml.Render()}</body></html>");
});
pattern: "{controller}/{action=Index}/{id?}");
});
}
}