In abp framwork how can I add a new field to identityUserRole?
I am facing the following error to add a new field to the table IdentityUserRole I will be glad if someone can guide me.
The type 'Volo.Abp.Identity.IdentityUserRole'
must be convertible to 'Volo.Abp.Data.IHasExtraProperties'
in order to use it as parameter 'TEntity' in the generic method 'ObjectExtensionManager Volo.Abp.ObjectExtending.EfCoreObjectExtensionManagerExtensions.MapEfCoreProperty<TEntity,TProperty>(this ObjectExtensionManager, string, Action<EntityTypeBuilder,PropertyBuilder>)'
2
Answers
This is how you can add a new field to UserRole with code logic:
In OnModelCreating in DbContext:
You can then create a migration and update the migration.
Open ModuleExtensionConfigurator class inside the Domain.Shared project of your solution and change the ConfigureExtraProperties method like below: