my code is:
public class UserGroupUser
{
public int UserGroupUserId { get; set; }
public string UserId { get; set; }
[Key, ForeignKey("UserId")]
public virtual ApplicationUser ApplicationUser { get; set; }
}
and when I try to create a controller I get this error:
EntityType 'IdentityUserLogin' had no key defined.Define the key for this entity type.
EntityType 'IdentityUserRole' had no key defined.Define the key for this entity type.
EntityType 'IdentityUserLogins' is based on 'IdentityUserLogin' that has no key defined.
EntityType: EnititySet 'IdentityUserRoles' is based on 'IdentityUserRole' that has no key defined.
but I can see the keys in my Database in SQL server management for all tables. how can I solve this problem?