using System.Reflection; using BlazorWebAssemblyVisaApiClient.Infrastructure.Services.DateTimeProvider; using FluentValidation; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using VisaApiClient; namespace BlazorWebAssemblyVisaApiClient; public class Program { public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); //todo move to launch settings const string baseAddress = "https://localhost:44370"; //todo make pretty builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(baseAddress) }); builder.Services.AddScoped(sp => new Client(baseAddress, sp.GetRequiredService())); builder.Services.AddSingleton(); builder.Services.AddAutoMapper(Assembly.GetExecutingAssembly()); builder.Services.AddValidatorsFromAssembly(Assembly.GetExecutingAssembly()); await builder.Build().RunAsync(); } }