services.AddRazorPages(); services.AddServerSideBlazor(); services.AddHttpClient();
services.AddScoped
var config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: true) .AddEnvironmentVariables() .Build();
services.AddSingleton(config);
[Inject] private IConfiguration Configuration { get; set; }
var settingValue = Configuration["SettingName"];
private readonly IConfiguration _configuration;
public TestController(IConfiguration configuration) { _configuration = configuration; }
var settingValue = _configuration["SettingName"];