TourIAm/TIAMWebApp/Client/Program.cs

39 lines
1.8 KiB
C#

using AyCode.Interfaces.StorageHandlers;
using Blazored.LocalStorage;
using DevExpress.Blazor;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.JSInterop;
using System.Reflection;
using System.Resources;
using TIAMWebApp.Client;
using TIAMWebApp.Client.Services;
using TIAMWebApp.Shared.Application.Interfaces;
using TIAMWebApp.Shared.Application.Utility;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddLocalization();
builder.Services.AddScoped<IWeatherForecastService, WeatherForecastService>();
builder.Services.AddScoped<ITransferDataService, TransferDataService>();
builder.Services.AddScoped<IPopulationStructureDataProvider, PopulationStructureDataProvider>();
builder.Services.AddScoped<ISupplierService, SupplierService>();
builder.Services.AddScoped<IUserDataService, UserDataServiceWeb>();
builder.Services.AddScoped<ISecureStorageHandler, SecureStorageHandler>();
builder.Services.AddScoped<LogToBrowserConsole>();
builder.Services.AddBlazoredLocalStorage();
builder.Services.AddSingleton<ISessionService, SessionServiceWeb>();
builder.Services.AddSingleton<IComponentUpdateService, ComponentUpdateServiceWeb>();
builder.Services.AddScoped<IServiceProviderDataService, ServiceProviderDataServiceWeb>();
//WebSpecific
builder.Services.AddScoped<SessionStorageAccessor>();
builder.Services.AddSingleton(x => new ResourceManager("TIAMWebApp.Client.Resources.MyResources", typeof(Program).Assembly));
//WebSpecific end
builder.Services.AddSingleton(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddDevExpressBlazor(configure => configure.BootstrapVersion = BootstrapVersion.v5);
await builder.Build().RunAsync();