in entity framework code first, how to use KeyAttribute on multiple columns
You can specify the column order in the attributes, for instance: public class MyEntity { [Key, Column(Order=0)] public int MyFirstKeyProperty { get; set; } [Key, Column(Order=1)] public int MySecondKeyProperty { get; set; } [Key, Column(Order=2)] public string MyThirdKeyProperty { get; set; } // other properties } If you are using the Find method of a … Read more