diff --git a/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/POST.md b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/POST.md new file mode 100644 index 0000000000..b0c743b36f --- /dev/null +++ b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/POST.md @@ -0,0 +1,31 @@ +# How to add the user entity as a navigation property? + +In this post, I'll show you how to add the user as a navigation property in your new entity. + +To do this, open the ABP Suite. Create a new entity called `Note`. + +![create-note-entity](create-note-entity.jpg) + +Then add a string property called `Title`. + +![add-simple-property](add-simple-property.jpg) + +To be able to add a user navigation, we need to create a user DTO to map from entity. To do this, create a new folder called "Users" in `*.Application.Contracts` then add a new class called `AppUserDto` inherited from `IdentityUserDto`. + +![create-appuserdto](create-appuserdto.jpg) + +Create the mapping for `AppUserDto`. To do this, open `YourProjectApplicationAutoMapperProfile.cs` and add the below line: + +```csharp +CreateMap().Ignore(x => x.ExtraProperties); +``` + +![create-mapping](create-mapping.jpg) + +Get back to ABP Suite, go to **Navigation Properties** tab. Click **Add Navigation Property** button. Browse `AppUser.cs` in `*.Domain\Users` folder. Then choose the `Name` item as display property. Browse `AppUserDto.cs` in `*.Contracts\Users` folder. Choose `Users` from Collection Names dropdown. + +![add-user-navigation](add-user-navigation.jpg) + +That's it! Click **Save and generate** button to create your page. You'll see the following page if there's everything goes well. + +![final-page](final-page.jpg) \ No newline at end of file diff --git a/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/add-simple-property.jpg b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/add-simple-property.jpg new file mode 100644 index 0000000000..346335d2f4 Binary files /dev/null and b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/add-simple-property.jpg differ diff --git a/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/add-user-navigation.jpg b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/add-user-navigation.jpg new file mode 100644 index 0000000000..a954176f7b Binary files /dev/null and b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/add-user-navigation.jpg differ diff --git a/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-appuserdto.jpg b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-appuserdto.jpg new file mode 100644 index 0000000000..4482f6dac9 Binary files /dev/null and b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-appuserdto.jpg differ diff --git a/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-mapping.jpg b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-mapping.jpg new file mode 100644 index 0000000000..7abe337082 Binary files /dev/null and b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-mapping.jpg differ diff --git a/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-note-entity.jpg b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-note-entity.jpg new file mode 100644 index 0000000000..e3d452e65c Binary files /dev/null and b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/create-note-entity.jpg differ diff --git a/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/final-page.jpg b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/final-page.jpg new file mode 100644 index 0000000000..8eb3110281 Binary files /dev/null and b/docs/en/Community-Articles/2020-08-31-Adding-User-Navigation-In-Suite/final-page.jpg differ