abp.io Navigation Property for IdentityUser/ AbpUser

Alex Bierhaus
2 min readOct 6, 2021

--

In one of my technical projects we developed a technical prototype based on the abp.io Framework in Version 4.4.

Here we had the challenge to map the already existing IdentityUser entity with a new one.

Since this topic comes up very often I decided to create a short and working article:

If you are using the commercial licencse you can use the abp suite to do the work for you. Just open the abp suite project, create the new entity and go to “Navigation properties”

Select “Add navigation property” and type in following information.

Dependent Entity

Entity namespace: Volo.Abp.Identity

Entity name: IdentityUser

Display property: Name

Dependent DTO

Dto name: IdentityUserDto

Dto namespace: Volo.Abp.Identity

Others

Property name: IdentityUserId

Collection names: Users

Normally the abp suite allows you to pick a dependent entity to automate the form for you, however, since we have no IdentityUser class here we have to do it manuall

Click OK and generate the entity afterwards.

Following Entity is generated:

Generated Entity

Following Code is added to the DbContext.cs

In this article we learned how to use the existing IdentitUser entity in your own entity. Since the framework is constantly evolving and only a few months ago (as of October 2021) the old AppUser entity was removed, it is important to check with newer versions if this way still works.

--

--

Alex Bierhaus
Alex Bierhaus

Written by Alex Bierhaus

Entrepreneur — technologist — passionate leader

Responses (4)