0

I am using MVC Core with the default individual user authentication. I added FullName field to AspNetUsers Table and it is working fine. I need to create a relationship between my tables to the id field in the AspNetUsers table so I can get the fullname of the user.

I have no idea on how to create relationship in Entity framework, I tried to add the following in the ApplicationUser Class

  public class ApplicationUser : IdentityUser
{

    public string FullName { get; set; }

    public mytable T { get; set; }
}

and

in mytable model, I added the following

public virtual ICollection<ApplicationUser> ApplicationUser { get; set; }

unfortunately, I am getting the following error:

The entity type 'IdentityUserLogin' requires a primary key to be defined

any idea?

Ahmad
  • 49
  • 1
  • 2
  • 9

1 Answers1

0

The first issue solved by following link

https://forums.asp.net/post/6144294.aspx

the IdentityUserLogin' requires a primary key to be defined also solved by

https://stackoverflow.com/a/40824620/7046796

Ahmad
  • 49
  • 1
  • 2
  • 9