- ABP Framework version: v3.3.2
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
Hi, I have overridden the CreateAsync method in IdentityUserAppService, and added an extra property named "isActiveDirectory":
public override async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input)
{
...
user.SetProperty(IsActiveDirectoryPropertyName, isActiveDirectory);
...
}
the extra property has been added successfully in db:
However, when we retrieve the mapping userDto, the ExtraProperties returned null
var userDto = ObjectMapper.Map<IdentityUser, IdentityUserDto>(user);
user.MapExtraPropertiesTo(userDto);
return userDto;
Could you please help me check?
Thank you.
4 Answer(s)
-
0
hi
https://docs.abp.io/en/abp/latest/Object-Extensions#mapextrapropertiesto https://docs.abp.io/en/abp/latest/Object-Extensions#automapper-integration
-
0
Hi maliming, I have implemented as the guide but it does not work.
If you look at my post, I already called the MapExtraPropertiesTo method:
user.MapExtraPropertiesTo(userDto);
I also added the mapping in the Mapper Profile:
CreateMap<IdentityUser, IdentityUserDto>().MapExtraProperties();
-
0
hi
Can you try to define a
isActiveDirectory
forIdentityUser
https://docs.abp.io/en/abp/latest/Object-Extensions#object-extension-manager
-
0
Hi @maliming, it works now.
Thank you.