Refactor API base URL config to use AppSettings class
Replaced direct IConfiguration usage with a strongly-typed AppSettings class for accessing the API base URL. Registered AppSettings with DI and updated Dashboard.razor to use IOptions<AppSettings>. Updated using statements and DI setup for improved type safety and centralized configuration management.
This commit is contained in:
6
DbFirst.BlazorWebApp/AppSettings.cs
Normal file
6
DbFirst.BlazorWebApp/AppSettings.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace DbFirst.BlazorWebApp;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
public string ApiBaseUrl { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user