58 lines
1.7 KiB
C#
58 lines
1.7 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<Fixedvalues>();
|
|
builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
|
{
|
|
Company = new CompanyAuthenticationDTO()
|
|
{
|
|
ID = 0,
|
|
IsAdmin = false,
|
|
Logo = "",
|
|
Name = ""
|
|
},
|
|
FullName = "",
|
|
Photo="",
|
|
Token="",
|
|
UserName = "",
|
|
enterDate =new DateTime(),
|
|
exitDate = new DateTime(),
|
|
}) ;
|
|
|
|
// Server
|
|
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
|
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://moadiran.ir:444/api/") });
|
|
|
|
//Home
|
|
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
|
|
|
//farzan
|
|
//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();
|
|
|