login service by localstorg
This commit is contained in:
@@ -3,12 +3,17 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Front;
|
||||
using System.Globalization;
|
||||
using Shared.DTOs;
|
||||
using Front.Services;
|
||||
using System.ComponentModel.Design;
|
||||
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
builder.Services.AddBlazorBootstrap();
|
||||
builder.Services.AddScoped<UserAuthenticationDTO>();
|
||||
|
||||
builder.Services.AddScoped<ILocalStorageService, LocalStorageService>();
|
||||
builder.Services.AddScoped<localService>();
|
||||
builder.Services.AddScoped(sp => new UserAuthenticationDTO());
|
||||
|
||||
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
|
||||
@@ -17,5 +22,14 @@ builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https:/
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
||||
|
||||
await builder.Build().RunAsync();
|
||||
var host = builder.Build();
|
||||
|
||||
|
||||
await new MidLevel(
|
||||
host.Services.GetRequiredService<ILocalStorageService>(),
|
||||
host.Services.GetRequiredService<UserAuthenticationDTO>(),
|
||||
host.Services.GetRequiredService<HttpClient>()
|
||||
).InitAsync();
|
||||
|
||||
await host.RunAsync();
|
||||
|
||||
|
Reference in New Issue
Block a user