Adding ApplicationUser as Navigation Property to entities #127
|
Hi, |
Answered by
iammukeshm
Nov 7, 2021
Replies: 1 comment 3 replies
|
Hi, ApplicationUser inherits from IdentityUser, which again has a dependency on Microsoft.AspNetCore.Identity package. If we were to add the ApplicationUser to Domain / Core Projects, this would add an additional dependency to the Core Layer which is not desirable. Here, ApplicationUser cannot be treated as an entity. Instead, we have an adapted class / dto named as UserDetailsDto. ApplicationUser is more of a secured model and should not be used as Navigation Property. |
3 replies
Answer selected by
iammukeshm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
ApplicationUser inherits from IdentityUser, which again has a dependency on Microsoft.AspNetCore.Identity package. If we were to add the ApplicationUser to Domain / Core Projects, this would add an additional dependency to the Core Layer which is not desirable. Here, ApplicationUser cannot be treated as an entity.
Instead, we have an adapted class / dto named as UserDetailsDto.
ApplicationUser is more of a secured model and should not be used as Navigation Property.