C#C
C#3y ago
Avalari

✅ [DDD] Reference IdentityUser in Domain model class

Hi, I'm starting my jurney with DDD so please take it easy on me 😄

Any pointers on how to reference AppUser : IdentityUser (that's in Persistence layer) in a domain model class?
I have some entities that have:
public int OwnerId { get; set; }
public virtual AppUser Owner { get; set; }

and I want to use .Include(u => u.Owner) when getting the data using EF Core.

Problem is that AppUser : IdentityUser is defined in the Persistence layer, which Domain Layer has no access to, nor does it have the EF package.
What would be the best approach to deal with this?
Was this page helpful?