Answers for "ef core identity get user with relationships"

C#
0

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);
Posted by: Guest on March-27-2022

C# Answers by Framework

Browse Popular Code Answers by Language