I use composite keys below the mvc model class of the same. I made two columns in the MS SQL Server database with both PK, FK, but I get an error in the class InitializeSimpleMembershipAttributeas "An exception was thrown by the target", please help me get how to create it. This is my model class.
[Table("webpages_UsersInRoles")]
public partial class UsersInRoles
{
[Column(Order = 0)]
public int RoleId { get; set; }
public virtual NewRoles roles { get; set; }
[Column(Order = 1)]
public int UserId { get; set; }
public virtual UserProfile UserProfiles { get; set; }
}
source
share