|
|
@ -1,6 +1,7 @@ |
|
|
using BlazorAdmin.Services; |
|
|
using BlazorAdmin.Services; |
|
|
using Blazored.LocalStorage; |
|
|
using Blazored.LocalStorage; |
|
|
using BlazorShared; |
|
|
using BlazorShared; |
|
|
|
|
|
using BlazorShared.Models; |
|
|
using Microsoft.AspNetCore.Components.Authorization; |
|
|
using Microsoft.AspNetCore.Components.Authorization; |
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; |
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
@ -27,13 +28,13 @@ namespace BlazorAdmin |
|
|
|
|
|
|
|
|
builder.Services.AddScoped<ToastService>(); |
|
|
builder.Services.AddScoped<ToastService>(); |
|
|
builder.Services.AddScoped<HttpService>(); |
|
|
builder.Services.AddScoped<HttpService>(); |
|
|
|
|
|
|
|
|
builder.Services.AddBlazoredLocalStorage(); |
|
|
builder.Services.AddBlazoredLocalStorage(); |
|
|
|
|
|
|
|
|
builder.Services.AddAuthorizationCore(); |
|
|
builder.Services.AddAuthorizationCore(); |
|
|
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthStateProvider>(); |
|
|
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthStateProvider>(); |
|
|
builder.Services.AddScoped(sp => (CustomAuthStateProvider)sp.GetRequiredService<AuthenticationStateProvider>()); |
|
|
builder.Services.AddScoped(sp => (CustomAuthStateProvider)sp.GetRequiredService<AuthenticationStateProvider>()); |
|
|
|
|
|
|
|
|
builder.Services.AddBlazorServices(); |
|
|
builder.Services.AddBlazorServices(); |
|
|
|
|
|
|
|
|
builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging")); |
|
|
builder.Logging.AddConfiguration(builder.Configuration.GetSection("Logging")); |
|
|
@ -48,7 +49,8 @@ namespace BlazorAdmin |
|
|
var sp = services.BuildServiceProvider(); |
|
|
var sp = services.BuildServiceProvider(); |
|
|
var localStorageService = sp.GetRequiredService<ILocalStorageService>(); |
|
|
var localStorageService = sp.GetRequiredService<ILocalStorageService>(); |
|
|
|
|
|
|
|
|
await localStorageService.RemoveItemAsync("brands"); |
|
|
await localStorageService.RemoveItemAsync(typeof(CatalogBrand).Name); |
|
|
|
|
|
await localStorageService.RemoveItemAsync(typeof(CatalogType).Name); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|