Files
moadiran/TaxPayerFull/Program.cs
mmrbnjd 7b8127dc72 ...
2024-04-29 07:58:41 +03:30

37 lines
1.2 KiB
C#

using Microsoft.AspNetCore.Components.Web;
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<ILocalStorageService, LocalStorageService>();
builder.Services.AddScoped<localService>();
builder.Services.AddScoped<HttpClientController>();
builder.Services.AddScoped(sp => new UserAuthenticationDTO());
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
var host = builder.Build();
await new MidLevel(
host.Services.GetRequiredService<ILocalStorageService>(),
host.Services.GetRequiredService<UserAuthenticationDTO>(),
host.Services.GetRequiredService<HttpClient>()
).InitAsync();
await host.RunAsync();