Multiple Primary Key with asp .net mvc 3
问题 I'm using asp .net mvc 3, and I have a problem with an entity that contains 2 primary key, when I try to insert data in the table. public class LineItem { [Key] public int OrderId { get; set;} [Key] public int LineNum { get; set;} public string ItemId { get; set;} public int Quantity { get; set;} public decimal UnitPrice { get; set; } } when I try to insert I got this error : Unable to determine composite primary key ordering for type 'ApplicationMVC3.Models.LineItem'. Use the ColumnAttribute