From bddccb343067b3543430884af16949aa55a67325 Mon Sep 17 00:00:00 2001 From: Ma Liming Date: Mon, 8 Sep 2025 17:12:44 +0800 Subject: [PATCH] Update configuration.md with contributor setup --- .../api-development/standard-apis/configuration.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/en/framework/api-development/standard-apis/configuration.md b/docs/en/framework/api-development/standard-apis/configuration.md index c1470fcf71..11e754f214 100644 --- a/docs/en/framework/api-development/standard-apis/configuration.md +++ b/docs/en/framework/api-development/standard-apis/configuration.md @@ -55,7 +55,16 @@ namespace Acme.BookStore.Web } ``` +Add your contributor instance to the `AbpApplicationConfigurationOptions` + +```csharp +Configure(options => +{ + options.Contributors.AddIfNotContains(new MyApplicationConfigurationContributor()); +}); +``` + * `IApplicationConfigurationContributor` defines the `ContributeAsync` method to extend the **application-configuration** endpoint with the specified additional data. -* You can inject services and perform any logic needed to extend the endpoint as you wish. +* You can get services from `context.ServiceProvider` and perform any logic needed to extend the endpoint as you wish. -> Application configuration contributors are automatically discovered by the ABP and executed as a part of the application configuration initialization process. +> Application configuration contributors are executed as a part of the application configuration initialization process.