- ABP Framework version: v4.0
Hi,
I've added extension column to users table which is a foreign key to another table. While creating a new tenant, framework tries to create an admin user for that tenant but it fails because of this extension column which is null while creating the admin user. How can I resolve this issue?
Thanks for your help.
4 Answer(s)
-
0
See https://docs.abp.io/en/abp/latest/Module-Entity-Extensions#default-value
-
0
That's not working while creating a tenant. Have you ever tested it? Can you provide a working example for IdentityUser entity?
Thanks.
-
0
You can also specify default value for the extension property in {ProjectName}EfCoreEntityExtensionMappings.cs inside {ProjectName}.EntityFrameworkCore project like this.
ObjectExtensionManager.Instance .MapEfCoreProperty<IdentityUser, string>( "SocialSecurityNumber", (entityBuilder, propertyBuilder) => { propertyBuilder.HasDefaultValue("test"); } );
-
0
It seems to be working. I've missed it because of an intellisense issue. Thanks for your help.