Leandro Hernan Rojas 6e592bd034
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 6m50s
Add UnitOfMeasure Search and Form
2025-07-15 12:42:30 -03:00

72 lines
2.8 KiB
C#

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>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
#region Proveedor de Autorizacion
builder.Services.AddScoped<CustomAuthorizationProvider>();
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthorizationProvider>(p => p.GetRequiredService<CustomAuthorizationProvider>());
builder.Services.AddScoped<ILoginService, CustomAuthorizationProvider>(p => p.GetRequiredService<CustomAuthorizationProvider>());
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<NavMenuService>();
#endregion
await builder.Build().RunAsync();
static void InjectDependencies(WebAssemblyHostBuilder builder)
{
builder.Services.AddScoped<ISalesLookupService, SalesLookupService>();
builder.Services.AddScoped<IStockLookUpService, StockLookUpService>();
builder.Services.AddScoped<IExchangeRateService, ExchangeRateService>();
builder.Services.AddScoped<ExchangeRateService>();
builder.Services.AddScoped<QuoteService>();
builder.Services.AddScoped<TicketsService>();
builder.Services.AddScoped<CustomerService>();
builder.Services.AddScoped<TaxConditionService>();
builder.Services.AddScoped<AccountTypeService>();
builder.Services.AddScoped<DocumentTypeService>();
builder.Services.AddScoped<InstitutionService>();
builder.Services.AddScoped<ProductService>();
builder.Services.AddScoped<BusinessUnitService>();
builder.Services.AddScoped<ProfessionalService>();
builder.Services.AddScoped<PeopleService>();
builder.Services.AddScoped<ProfessionalSpecialtyService>();
builder.Services.AddScoped<ProductCategoryService>();
builder.Services.AddScoped<PatientService>();
builder.Services.AddScoped<ProductDivisionService>();
builder.Services.AddScoped<LSProductService>();
builder.Services.AddScoped<LSUnitOfMeasureService>();
}