0
learnabp created
I have created a ExtraProperty for the User called "isActive"
ObjectExtensionManager.Instance.Modules()
.ConfigureSaas(Saas =>
{
Saas.ConfigureTenant(tenant =>
{
tenant.AddOrUpdateProperty<bool>( //property type: string
"isActive", //property name
property =>
{
//validation rules
property.Attributes.Add(new RequiredAttribute());
property.DefaultValue = true;
//...other configurations for this property
}
);
});
});
however this is not binding to the ui when i click edit i can see the isActive checkbox but the value is always true even when the isActive checkox doesn't have a tick mark
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
9 Answer(s)
-
0
I am doing for user not tenant sorry the code is as follows
and i am using 4.3.2
ObjectExtensionManager.Instance.Modules() .ConfigureIdentity(identity => { identity.ConfigureUser(user => { user.AddOrUpdateProperty<bool>( //property type: string "isActive", //property name property => { //validation rules property.Attributes.Add(new RequiredAttribute()); property.DefaultValue = true; //...other configurations for this property } ); }); });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
I found the issue its in the Update method of IndentityUserAppService
await UpdateUserByInput(user, input); input.MapExtraPropertiesTo(user); (await UserManager.UpdateAsync(user)).CheckErrors(); await CurrentUnitOfWork.SaveChangesAsync();the is not manpping from IdenityUserUpdateDto to IdentityUser hence i added to make modification from this
input.MapExtraPropertiesTo(user);to
input.MapExtraPropertiesTo(user, MappingPropertyDefinitionChecks.Source);Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
