Skip to content

Commit

Permalink
Update configure way of `AbpFeatureManagementApplicationContractsOpti…
Browse files Browse the repository at this point in the history
…ons`.
  • Loading branch information
maliming committed Jan 10, 2022
1 parent 36fe11a commit 3b12c26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ public override void ConfigureServices(ServiceConfigurationContext context)
options.FileSets.AddEmbedded<AbpFeatureManagementApplicationContractsModule>();
});

var contractsOptionsActions = context.Services.GetPreConfigureActions<AbpFeatureManagementApplicationContractsOptions>();
Configure<AbpFeatureManagementApplicationContractsOptions>(options =>
{
context.Services.ExecutePreConfiguredActions(options);
contractsOptionsActions.Configure(options);
});

Configure<AbpNewtonsoftJsonSerializerOptions>(options =>
{
options.Converters.Add<NewtonsoftStringValueTypeJsonConverter>();
});

Configure<AbpSystemTextJsonSerializerOptions>(options =>
{
var contractsOptions = context.Services.ExecutePreConfiguredActions<AbpFeatureManagementApplicationContractsOptions>();
options.JsonSerializerOptions.Converters.AddIfNotContains(new StringValueTypeJsonConverter(contractsOptions));
options.JsonSerializerOptions.Converters.AddIfNotContains(new StringValueTypeJsonConverter(contractsOptionsActions.Configure()));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public override void ConfigureServices(ServiceConfigurationContext context)
.AddBaseTypes(typeof(AbpUiResource));
});

var contractsOptions = context.Services.ExecutePreConfiguredActions<AbpFeatureManagementApplicationContractsOptions>();
Configure<JsonOptions>(options =>
{
var contractsOptions = context.Services.ExecutePreConfiguredActions<AbpFeatureManagementApplicationContractsOptions>();
options.JsonSerializerOptions.Converters.AddIfNotContains(new StringValueTypeJsonConverter(contractsOptions));
});
}
Expand Down

0 comments on commit 3b12c26

Please sign in to comment.