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 or the HasKey method to specify an order for composite primary keys.
May someone help me please !!