Hi, How to do object Extension for a newly added module. For ex. I added Module A to the main app. I have an entity Apple in ModuleA. I need to add some field to Object Extension . how can i achieve it Provide us with the following info:
- ABP Framework version:Abp commercial v8.0.4
- UI Type: Blazor Server
- Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..)
- Tiered (for MVC) or Auth Server Separated (for Angular): no
- Exception message and full stack trace:
- Steps to reproduce the issue:
12 Answer(s)
-
0
Hi,
You can check the document: https://docs.abp.io/en/abp/latest/Module-Entity-Extensions
ObjectExtensionManager.Instance.Modules() .ConfigureModuleA(moduleA => { moduleA.ConfigureApple(user => { user.AddOrUpdateProperty<Guid>( "DepartmentId", property => { property.UI.Lookup.Url = "/api/departments"; property.UI.Lookup.DisplayPropertyName = "name"; } ); }); });
You need to create some extension methods for Module A, for example:
https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/ObjectExtending/IdentityModuleExtensionConfigurationDictionaryExtensions.cs#L8
https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/ObjectExtending/IdentityModuleExtensionConfiguration.cs#L8
https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/IdentityDbContextModelBuilderExtensions.cs#L301
-
0
-
0
Hi,
Here are some configurations: https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs#L26 https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs#L77 https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs#L19 https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/AbpIdentityApplicationContractsModule.cs#L28 https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs#L107
-
0
Hi, ModuleExtensionConfigurationHelper .ApplyEntityConfigurationToUi( IdentityModuleExtensionConsts.ModuleName, IdentityModuleExtensionConsts.EntityNames.User, createFormTypes: new[] { typeof(Volo.Abp.Identity.Web.Pages.Identity.Users.CreateModalModel.UserInfoViewModel) }, editFormTypes: new[] { typeof(Volo.Abp.Identity.Web.Pages.Identity.Users.EditModalModel.UserInfoViewModel) } ); in CreateFormTypes what will come for BlazorServer UI
-
0
Hi,
This is the Blazor server config:
https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Blazor/AbpIdentityBlazorModule.cs#L58
It will automatically add extension fields to create and edit UI
-
0
ObjectExtensionManager.Instance.Modules() .ConfigureModuleA(moduleA => { moduleA.ConfigureApple(user => { user.AddOrUpdateProperty<Guid>( "DepartmentId", property => { property.UI.Lookup.Url = "/api/departments"; property.UI.Lookup.DisplayPropertyName = "name"; } ); }); }); property.UI.Lookup.Url = "/api/departments"; property.UI.Lookup.DisplayPropertyName = "name"; why is this needed? is this controller Route
-
0
Hi,
This is just an example code; you can check the document https://docs.abp.io/en/abp/latest/Module-Entity-Extensions
-
0
Hi, Got it.. Thanks
-
0
: )
-
0
-
0
This is how ABP did :
https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs#L230-L231 https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.BlazoriseUI/Components/AbpExtensibleDataGrid.razor#L121-L156
The suite generated code for Blazor UI doesn't support module object extension yet, we will improve it in 8.3 version.
-
0
Thank you