using phronCare.UIBlazor; using phronCare.UIBlazor.Services.UI; using phronCare.UIBlazor.Services.Sales; using phronCare.UIBlazor.Services.Lookups; using phronCare.UIBlazor.Services.Tickets; using phronCare.UIBlazor.Services.Authorization; using phronCare.UIBlazor.Services.Sales.Quotes; using phronCare.UIBlazor.Services.Integrations; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Blazored.Modal; using Blazored.Toast; using phronCare.UIBlazor.Services.Stock; var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); #region Proveedor de Autorizacion builder.Services.AddScoped(); builder.Services.AddScoped(p => p.GetRequiredService()); builder.Services.AddScoped(p => p.GetRequiredService()); builder.Services.AddAuthorizationCore(); #endregion #region Load Configuration var config = builder.Configuration.GetSection("BaseAd").Value; if (config != null) { builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(config) }); } #endregion #region Injection Dependencis InjectDependencies(builder); #endregion #region UI builder.Services.AddBlazoredModal(); builder.Services.AddBlazoredToast(); builder.Services.AddSingleton(); #endregion await builder.Build().RunAsync(); static void InjectDependencies(WebAssemblyHostBuilder builder) { builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); }