Use AddHttpContextAccessor()

This commit is contained in:
hishamco
2020-10-12 18:26:04 +03:00
parent 4b11bdc4be
commit edc65e66c9
2 changed files with 1 additions and 3 deletions

View File

@ -8,7 +8,6 @@ using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Oqtane.Modules;
using Oqtane.Providers;
@ -27,7 +26,7 @@ namespace Oqtane.Client
builder.Services.AddSingleton(httpClient);
builder.Services.AddOptions();
builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
builder.Services.AddHttpContextAccessor();
// Register localization services
builder.Services.AddLocalization(options => options.ResourcesPath = "Resources");