diff --git a/DbFirst.BlazorWebApp/Program.cs b/DbFirst.BlazorWebApp/Program.cs index a477173..ef6ed42 100644 --- a/DbFirst.BlazorWebApp/Program.cs +++ b/DbFirst.BlazorWebApp/Program.cs @@ -13,12 +13,12 @@ builder.Services.AddDevExpressBlazor(options => options.BootstrapVersion = Boots builder.Services.AddScoped(); builder.Services.AddScoped(); -var apiBaseUrl = builder.Configuration["ApiBaseUrl"]; builder.Services.Configure(builder.Configuration); +var appSettings = builder.Configuration.Get() ?? new AppSettings(); void ConfigureClient(HttpClient client) { - if (!string.IsNullOrWhiteSpace(apiBaseUrl)) - client.BaseAddress = new Uri(apiBaseUrl); + if (!string.IsNullOrWhiteSpace(appSettings.ApiBaseUrl)) + client.BaseAddress = new Uri(appSettings.ApiBaseUrl); } builder.Services.AddHttpClient(ConfigureClient);