{"Unable to determine composite primary key ordering for type 'Conference_Project.Models.Login'. Use the ColumnAttribute (see http://go.microsoft.com/fwlink/?LinkId=386388) or the HasKey method (see http://go.microsoft.com/fwlink/?LinkId=386387) to specify an order for composite primary keys."}
[Table("ConferenceLogin")]
public class Login
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long confid { get; set; }
[Key]
public string emailID { get; set; }
[Key]
public string registration { get; set; }
[Key]
public long regNo { get; set; }
}
Version Used : EntityFramework.6.1.3 And MVC5
I want unique value for this (emailID , registration , regNo ) for that
set all as primary key then EntityFramework showed error
how to use multiple primary key with EntityFramework?

HasKeybeforeCreateModel()used like this:builder.Entity<ForeignTablePropertyName>().HasKey(p => new { p.emailID, p.registration, p.regNo });. - Tetsuya Yamamoto