From b6f12bea2c304cc589597e76f1ad8dad810eb394 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 24 Nov 2020 14:29:22 +0800 Subject: [PATCH 1/3] Update Overriding a Controller. Resolve #6297 --- ...ustomizing-Application-Modules-Overriding-Services.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index 133b2e89eb..44fd6a8df1 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/en/Customizing-Application-Modules-Overriding-Services.md @@ -196,6 +196,15 @@ This example replaces the `AccountController` (An API Controller defined in the **`[ExposeServices(typeof(AccountController))]` is essential** here since it registers this controller for the `AccountController` in the dependency injection system. `[Dependency(ReplaceServices = true)]` is also recommended to clear the old registration (even the ASP.NET Core DI system selects the last registered one). +In addition, The `AccountController` will be removed `AccountController` from [`ApplicationModel`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.applicationmodels.applicationmodel.controllers?view=aspnetcore-5.0#Microsoft_AspNetCore_Mvc_ApplicationModels_ApplicationModel_Controllers) because it defines `ExposeServicesAttribute`. If you don't want to remove it, you can configure `AbpAspNetCoreMvcOptions`: + +```csharp +Configure(options => +{ + options.IgnoredControllersOnModelExclusion.AddIfNotContains(typeof(AccountController)); +}); +``` + ### Overriding Other Classes Overriding controllers, framework services, view component classes and any other type of classes registered to dependency injection can be overridden just like the examples above. From e49f217fcb2ba17d50ab303daaed7ad471a85648 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 24 Nov 2020 14:31:37 +0800 Subject: [PATCH 2/3] Update Customizing-Application-Modules-Overriding-Services.md --- docs/en/Customizing-Application-Modules-Overriding-Services.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index 44fd6a8df1..975aa94d87 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/en/Customizing-Application-Modules-Overriding-Services.md @@ -196,7 +196,7 @@ This example replaces the `AccountController` (An API Controller defined in the **`[ExposeServices(typeof(AccountController))]` is essential** here since it registers this controller for the `AccountController` in the dependency injection system. `[Dependency(ReplaceServices = true)]` is also recommended to clear the old registration (even the ASP.NET Core DI system selects the last registered one). -In addition, The `AccountController` will be removed `AccountController` from [`ApplicationModel`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.applicationmodels.applicationmodel.controllers?view=aspnetcore-5.0#Microsoft_AspNetCore_Mvc_ApplicationModels_ApplicationModel_Controllers) because it defines `ExposeServicesAttribute`. If you don't want to remove it, you can configure `AbpAspNetCoreMvcOptions`: +In addition, The `AccountController` will be removed from [`ApplicationModel`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.applicationmodels.applicationmodel.controllers?view=aspnetcore-5.0#Microsoft_AspNetCore_Mvc_ApplicationModels_ApplicationModel_Controllers) because it defines `ExposeServicesAttribute`. If you don't want to remove it, you can configure `AbpAspNetCoreMvcOptions`: ```csharp Configure(options => From fae3ea355e63ec4bab8dc444217f520cf66120ba Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 24 Nov 2020 14:32:50 +0800 Subject: [PATCH 3/3] Update Customizing-Application-Modules-Overriding-Services.md --- docs/en/Customizing-Application-Modules-Overriding-Services.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/Customizing-Application-Modules-Overriding-Services.md b/docs/en/Customizing-Application-Modules-Overriding-Services.md index 975aa94d87..ab6f29816b 100644 --- a/docs/en/Customizing-Application-Modules-Overriding-Services.md +++ b/docs/en/Customizing-Application-Modules-Overriding-Services.md @@ -196,7 +196,7 @@ This example replaces the `AccountController` (An API Controller defined in the **`[ExposeServices(typeof(AccountController))]` is essential** here since it registers this controller for the `AccountController` in the dependency injection system. `[Dependency(ReplaceServices = true)]` is also recommended to clear the old registration (even the ASP.NET Core DI system selects the last registered one). -In addition, The `AccountController` will be removed from [`ApplicationModel`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.applicationmodels.applicationmodel.controllers?view=aspnetcore-5.0#Microsoft_AspNetCore_Mvc_ApplicationModels_ApplicationModel_Controllers) because it defines `ExposeServicesAttribute`. If you don't want to remove it, you can configure `AbpAspNetCoreMvcOptions`: +In addition, The `AccountController` will be removed from [`ApplicationModel`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.applicationmodels.applicationmodel.controllers) because it defines `ExposeServicesAttribute`. If you don't want to remove it, you can configure `AbpAspNetCoreMvcOptions`: ```csharp Configure(options =>