Skip to content

Commit

Permalink
Merge pull request #30 from masastack/feature/blazor-wasm
Browse files Browse the repository at this point in the history
♻ refactor(wasm):  AddMasaStackConfigAsync Adjustment
  • Loading branch information
wzh425 authored Jan 10, 2025
2 parents e87df72 + fe5a27b commit c297895
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Microsoft.Extensions.DependencyInjection;

public static class ServiceCollectionExtensions
{
public static async Task<IServiceCollection> AddMasaStackConfigAsync(this IServiceCollection services, IConfiguration configuration, string environment)
public static async Task<IServiceCollection> AddMasaStackConfigAsync(this IServiceCollection services, IConfiguration configuration)
{
var configs = GetConfigMap(configuration, environment);
var configs = GetConfigMap(configuration);

services.TryAddScoped<MasaComponentsClaimsCache>();
services.TryAddSingleton<IClientScopeServiceProviderAccessor, ComponentsClientScopeServiceProviderAccessor>();
Expand Down Expand Up @@ -36,7 +36,7 @@ public static IMultiEnvironmentMasaStackConfig GetMultiEnvironmentMasaStackConfi
return services.BuildServiceProvider().GetRequiredService<IMultiEnvironmentMasaStackConfig>();
}

private static Dictionary<string, string> GetConfigMap(IConfiguration configuration, string environment)
private static Dictionary<string, string> GetConfigMap(IConfiguration configuration)
{
var configs = new Dictionary<string, string>()
{
Expand All @@ -47,7 +47,7 @@ private static Dictionary<string, string> GetConfigMap(IConfiguration configurat
{ MasaStackConfigConstant.CLUSTER, configuration.GetValue<string>(MasaStackConfigConstant.CLUSTER) },
{ MasaStackConfigConstant.OTLP_URL, configuration.GetValue<string>(MasaStackConfigConstant.OTLP_URL) },
{ MasaStackConfigConstant.MASA_STACK, configuration.GetValue<string>(MasaStackConfigConstant.MASA_STACK) },
{ MasaStackConfigConstant.ENVIRONMENT, environment }
{ MasaStackConfigConstant.ENVIRONMENT, configuration.GetValue<string>(MasaStackConfigConstant.ENVIRONMENT) }
};
return configs;
}
Expand Down

0 comments on commit c297895

Please sign in to comment.