diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs index fb438221e..7a48e93ed 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs @@ -12,6 +12,7 @@ using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.OpenApi.Models; using System; @@ -49,7 +50,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator } // 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) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { var pathBase = Configuration["PATH_BASE"]; diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs index f99a7a5aa..27ee6db3e 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs @@ -13,6 +13,7 @@ using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.OpenApi.Models; using System; @@ -50,7 +51,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator } // 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) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { var pathBase = Configuration["PATH_BASE"]; if (!string.IsNullOrEmpty(pathBase)) diff --git a/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs b/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs index a1fda6455..60102ee74 100644 --- a/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs +++ b/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs @@ -20,7 +20,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data { private readonly IPasswordHasher _passwordHasher = new PasswordHasher(); - public async Task SeedAsync(ApplicationDbContext context,IHostingEnvironment env, + public async Task SeedAsync(ApplicationDbContext context,IWebHostEnvironment env, ILogger logger, IOptions settings,int? retry = 0) { int retryForAvaiability = retry.Value; diff --git a/src/Services/Identity/Identity.API/Program.cs b/src/Services/Identity/Identity.API/Program.cs index 784f63a1e..ad708c0f4 100644 --- a/src/Services/Identity/Identity.API/Program.cs +++ b/src/Services/Identity/Identity.API/Program.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.eShopOnContainers.Services.Identity.API.Data; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Serilog; @@ -32,7 +33,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API host.MigrateDbContext((_, __) => { }) .MigrateDbContext((context, services) => { - var env = services.GetService(); + var env = services.GetService(); var logger = services.GetService>(); var settings = services.GetService>(); diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index feefbcee3..7533e5ff3 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -16,6 +16,7 @@ using Microsoft.eShopOnContainers.Services.Identity.API.Services; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using StackExchange.Redis; using System; @@ -117,7 +118,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API } // 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) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { //loggerFactory.AddConsole(Configuration.GetSection("Logging")); //loggerFactory.AddDebug(); diff --git a/src/Services/Identity/Identity.API/web.config b/src/Services/Identity/Identity.API/web.config index dc0514fca..a2cf1fe26 100644 --- a/src/Services/Identity/Identity.API/web.config +++ b/src/Services/Identity/Identity.API/web.config @@ -1,14 +1,17 @@  - - - + - + + + + + + - + \ No newline at end of file diff --git a/src/Services/Marketing/Marketing.API/Controllers/PicController.cs b/src/Services/Marketing/Marketing.API/Controllers/PicController.cs index 66ce1e750..740f4975b 100644 --- a/src/Services/Marketing/Marketing.API/Controllers/PicController.cs +++ b/src/Services/Marketing/Marketing.API/Controllers/PicController.cs @@ -7,8 +7,8 @@ [ApiController] public class PicController : ControllerBase { - private readonly IHostingEnvironment _env; - public PicController(IHostingEnvironment env) + private readonly IWebHostEnvironment _env; + public PicController(IWebHostEnvironment env) { _env = env; } diff --git a/src/Services/Marketing/Marketing.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs b/src/Services/Marketing/Marketing.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs index 14e79775d..19c5ab038 100644 --- a/src/Services/Marketing/Marketing.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs +++ b/src/Services/Marketing/Marketing.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs @@ -5,15 +5,16 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure.ActionResults; + using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System.Net; public class HttpGlobalExceptionFilter : IExceptionFilter { - private readonly IHostingEnvironment env; + private readonly IWebHostEnvironment env; private readonly ILogger logger; - public HttpGlobalExceptionFilter(IHostingEnvironment env, ILogger logger) + public HttpGlobalExceptionFilter(IWebHostEnvironment env, ILogger logger) { this.env = env; this.logger = logger; diff --git a/src/Services/Marketing/Marketing.API/Startup.cs b/src/Services/Marketing/Marketing.API/Startup.cs index ff6fdd43a..4c2c2a710 100644 --- a/src/Services/Marketing/Marketing.API/Startup.cs +++ b/src/Services/Marketing/Marketing.API/Startup.cs @@ -152,7 +152,7 @@ } // 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) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { //loggerFactory.AddAzureWebAppDiagnostics(); //loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs index a4ce415ea..8b7587744 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs @@ -6,15 +6,16 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.ActionResults; + using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System.Net; public class HttpGlobalExceptionFilter : IExceptionFilter { - private readonly IHostingEnvironment env; + private readonly IWebHostEnvironment env; private readonly ILogger logger; - public HttpGlobalExceptionFilter(IHostingEnvironment env, ILogger logger) + public HttpGlobalExceptionFilter(IWebHostEnvironment env, ILogger logger) { this.env = env; this.logger = logger; diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs b/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs index 7dcbe194e..89148f43a 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs @@ -20,7 +20,7 @@ public class OrderingContextSeed { - public async Task SeedAsync(OrderingContext context, IHostingEnvironment env,IOptions settings, ILogger logger) + public async Task SeedAsync(OrderingContext context, IWebHostEnvironment env,IOptions settings, ILogger logger) { var policy = CreatePolicy(logger, nameof(OrderingContextSeed)); diff --git a/src/Services/Ordering/Ordering.API/Program.cs b/src/Services/Ordering/Ordering.API/Program.cs index 899871b3d..9c734699c 100644 --- a/src/Services/Ordering/Ordering.API/Program.cs +++ b/src/Services/Ordering/Ordering.API/Program.cs @@ -34,7 +34,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API Log.Information("Applying migrations ({ApplicationContext})...", AppName); host.MigrateDbContext((context, services) => { - var env = services.GetService(); + var env = services.GetService(); var settings = services.GetService>(); var logger = services.GetService>(); diff --git a/src/Services/Ordering/Ordering.FunctionalTests/OrderingScenarioBase.cs b/src/Services/Ordering/Ordering.FunctionalTests/OrderingScenarioBase.cs index 5b2979e1a..c7645cc3d 100644 --- a/src/Services/Ordering/Ordering.FunctionalTests/OrderingScenarioBase.cs +++ b/src/Services/Ordering/Ordering.FunctionalTests/OrderingScenarioBase.cs @@ -36,7 +36,7 @@ namespace Ordering.FunctionalTests testServer.Host .MigrateDbContext((context, services) => { - var env = services.GetService(); + var env = services.GetService(); var settings = services.GetService>(); var logger = services.GetService>(); diff --git a/src/Services/Webhooks/Webhooks.API/Infrastructure/HttpGlobalExceptionFilter.cs b/src/Services/Webhooks/Webhooks.API/Infrastructure/HttpGlobalExceptionFilter.cs index e0138ef8e..44cc9547a 100644 --- a/src/Services/Webhooks/Webhooks.API/Infrastructure/HttpGlobalExceptionFilter.cs +++ b/src/Services/Webhooks/Webhooks.API/Infrastructure/HttpGlobalExceptionFilter.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; @@ -15,10 +16,10 @@ namespace Webhooks.API.Infrastructure { public class HttpGlobalExceptionFilter : IExceptionFilter { - private readonly IHostingEnvironment env; + private readonly IWebHostEnvironment env; private readonly ILogger logger; - public HttpGlobalExceptionFilter(IHostingEnvironment env, ILogger logger) + public HttpGlobalExceptionFilter(IWebHostEnvironment env, ILogger logger) { this.env = env; this.logger = logger; diff --git a/src/Web/WebMVC/Infrastructure/WebContextSeed.cs b/src/Web/WebMVC/Infrastructure/WebContextSeed.cs index bc4165c0a..ab3b8d801 100644 --- a/src/Web/WebMVC/Infrastructure/WebContextSeed.cs +++ b/src/Web/WebMVC/Infrastructure/WebContextSeed.cs @@ -13,7 +13,7 @@ namespace WebMVC.Infrastructure { public class WebContextSeed { - public static void Seed(IApplicationBuilder applicationBuilder, IHostingEnvironment env) + public static void Seed(IApplicationBuilder applicationBuilder, IWebHostEnvironment env) { var log = Serilog.Log.Logger; diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index bfba90662..299af38cb 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -13,6 +13,7 @@ using Microsoft.eShopOnContainers.WebMVC.ViewModels; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Logging; using StackExchange.Redis; @@ -53,7 +54,7 @@ namespace Microsoft.eShopOnContainers.WebMVC } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Remove("sub"); if (env.IsDevelopment()) diff --git a/src/Web/WebSPA/Server/Controllers/HomeController.cs b/src/Web/WebSPA/Server/Controllers/HomeController.cs index 3bb021943..14e8a8871 100644 --- a/src/Web/WebSPA/Server/Controllers/HomeController.cs +++ b/src/Web/WebSPA/Server/Controllers/HomeController.cs @@ -9,10 +9,10 @@ namespace eShopConContainers.WebSPA.Server.Controllers { public class HomeController : Controller { - private readonly IHostingEnvironment _env; + private readonly IWebHostEnvironment _env; private readonly IOptionsSnapshot _settings; - public HomeController(IHostingEnvironment env, IOptionsSnapshot settings) + public HomeController(IWebHostEnvironment env, IOptionsSnapshot settings) { _env = env; _settings = settings; diff --git a/src/Web/WebSPA/Server/Infrastructure/WebContextSeed.cs b/src/Web/WebSPA/Server/Infrastructure/WebContextSeed.cs index 74de66b5c..d897ddac5 100644 --- a/src/Web/WebSPA/Server/Infrastructure/WebContextSeed.cs +++ b/src/Web/WebSPA/Server/Infrastructure/WebContextSeed.cs @@ -13,7 +13,7 @@ namespace WebSPA.Infrastructure { public class WebContextSeed { - public static void Seed(IApplicationBuilder applicationBuilder, IHostingEnvironment env, ILoggerFactory loggerFactory) + public static void Seed(IApplicationBuilder applicationBuilder, IWebHostEnvironment env, ILoggerFactory loggerFactory) { var log = loggerFactory.CreateLogger(); diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index 367d494ba..2b50e7add 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using StackExchange.Redis; using System; @@ -61,7 +62,7 @@ namespace eShopConContainers.WebSPA } // 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, IAntiforgery antiforgery) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory, IAntiforgery antiforgery) { loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); diff --git a/src/Web/WebStatus/Startup.cs b/src/Web/WebStatus/Startup.cs index c68239c32..bb7af4ab0 100644 --- a/src/Web/WebStatus/Startup.cs +++ b/src/Web/WebStatus/Startup.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; namespace WebStatus @@ -35,7 +36,7 @@ namespace WebStatus } // 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) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { //loggerFactory.AddAzureWebAppDiagnostics(); //loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Trace); diff --git a/src/Web/WebhookClient/Startup.cs b/src/Web/WebhookClient/Startup.cs index f93f61a5f..e61affd18 100644 --- a/src/Web/WebhookClient/Startup.cs +++ b/src/Web/WebhookClient/Startup.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using System; using System.Linq; using System.Net; @@ -42,7 +43,7 @@ namespace WebhookClient } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { var pathBase = Configuration["PATH_BASE"];