37 lines
1.2 KiB
C#
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();
|
|
|