Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

ef core identity get user with relationships

First add relationship to ApplicationUser

public class ApplicationUser : IdentityUser
{
  public string Name { get; set; }
  public string Surname { get; set; }

  public IList<Address> Address { get; set; }
}

and then you call call it easly using UserManager Class

var user = await userManager.Users.Include(x => x.Address).SingleOrDefaultAsync(x => x.Id == Id);
 
PREVIOUS NEXT
Tagged: #ef #core #identity #user #relationships
ADD COMMENT
Topic
Name
9+5 =