@ -139,6 +139,59 @@ When you look at your database, you can see that the `Department` table has been

> It's good to have some initial data in the database before running the application. This section introduces the [Data Seeding](https://docs.abp.io/en/abp/latest/Data-Seeding) system of the ABP framework. You can skip this section if you don't want to create the data seeding, but it is suggested to follow along and learn this useful ABP Framework feature.
Create a class deriving from the `IDataSeedContributor` in the `IdentityRelationship.Domain` project by copying the following code:
```csharp
using System;
using System.Threading.Tasks;
using IdentityRelationship.Departments;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
namespace IdentityRelationship;
public class IdentityRelationshipDataSeederContributor
public IdentityRelationshipDataSeederContributor(IRepository<Department,Guid> departmentRepository)
{
_departmentRepository = departmentRepository;
}
public async Task SeedAsync(DataSeedContext context)
{
if (await _departmentRepository.GetCountAsync() <= 0)
{
await _departmentRepository.InsertAsync(
new Department
{
Name = "Human Resources"
},
autoSave: true
);
await _departmentRepository.InsertAsync(
new Department
{
Name = "Production"
},
autoSave: true
);
}
}
}
```
- This code simply uses the `IRepository<Department, Guid>` (the default [repository](https://docs.abp.io/en/abp/latest/Repositories)) to insert two books to the database in case there weren't any books in it.
Run the `IdentityRelationship.DbMigrator` application to update the database:

Again, open the `IdentityRelationshipModuleExtensionConfigurator` class in the Domain.Shared project and add the following code:
The `UI.Lookup.Url` option takes a URL to get the list of departments to select on the edit/create forms. This endpoint can be a typical controller, an auto API controller or any type of endpoint that returns a proper JSON response.
To localize, open the `IdentityRelationship.Domain.Shared` project and add it to your `/Localization/IdentityRelationship/en.json` file:
```json
"DepartmentId": "Department"
```
Create a `Departments` folder in the `IdentityRelationship.Application.Contracts` project of your solution and add the `DepartmentDto` class in it
`DepartmentAppService `is using the `ObjectMapper` to convert the `Department` objects to `DepartmentDto` objects. So, we need to define this mapping in the AutoMapper configuration.
Open the `IdentityRelationshipApplicationAutoMapperProfile` class inside the `IdentityRelationship.Application` project and add the following line to the constructor:
```csharp
using AutoMapper;
using IdentityRelationship.Departments;
namespace IdentityRelationship;
public class IdentityRelationshipApplicationAutoMapperProfile : Profile
{
public IdentityRelationshipApplicationAutoMapperProfile()
In this article I talked about the IdentityUser's relationships. Thank you for reading the article, I hope it was useful. See you soon!
In this article I talked about the use of the IdentityUser relationship and how to extend it. Thank you for reading the article, I hope it was useful. See you soon!