Use AddHttpContextAccessor()
This commit is contained in:
parent
4b11bdc4be
commit
edc65e66c9
|
@ -33,7 +33,6 @@
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="3.1.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="3.1.4" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="3.1.3" />
|
<PackageReference Include="Microsoft.Extensions.Localization" Version="3.1.3" />
|
||||||
<PackageReference Include="System.Net.Http.Json" Version="3.2.0" />
|
<PackageReference Include="System.Net.Http.Json" Version="3.2.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -8,7 +8,6 @@ using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Oqtane.Modules;
|
using Oqtane.Modules;
|
||||||
using Oqtane.Providers;
|
using Oqtane.Providers;
|
||||||
|
@ -27,7 +26,7 @@ namespace Oqtane.Client
|
||||||
|
|
||||||
builder.Services.AddSingleton(httpClient);
|
builder.Services.AddSingleton(httpClient);
|
||||||
builder.Services.AddOptions();
|
builder.Services.AddOptions();
|
||||||
builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
|
builder.Services.AddHttpContextAccessor();
|
||||||
|
|
||||||
// Register localization services
|
// Register localization services
|
||||||
builder.Services.AddLocalization(options => options.ResourcesPath = "Resources");
|
builder.Services.AddLocalization(options => options.ResourcesPath = "Resources");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user