Skip to content

Can't map Application User with Domain entities. #655

Discussion options

You must be logged in to vote

The ApplicationUser extends IdentityUser which is considered Infrastructure (relating to the Identity framework). The missing piece is a Domain entity representing your users, let's keep it simple and create a User in the Domain:

public class  User
{
  public int Id { get; set; }
  public string ApplicationUserId { get; set; } // You could also just make this the primary key.

  public string Name { get; set; }
  public string Email { get; set; }
}

This class represents the user within your Domain. Other Domain entities, can include navigation properties to this entity. For example:

public class  Message
{
  public int Id { get; set; }
  public string SenderId { get; set; }
  public string 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mubassir-hasan
Comment options

Answer selected by mubassir-hasan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants