Assuming this is actually a composite key, since you cannot have 2 primary keys ... The error message tells you what to do, namely: add the order. You can do this by adding [Column(Order = 0)] and [Column(Order = 1)] to your key columns.
In your example:
public class LineItem { [Key][Column(Order = 0)] public int OrderId { get; set;} [Key][Column(Order = 1)] public int LineNum { get; set;} public string ItemId { get; set;} public int Quantity { get; set;} public decimal UnitPrice { get; set; } }
verdesmarald May 11 '11 at 10:24 2011-05-11 10:24
source share