Entity Framework Complex Type property as key

c# entity-framework entity-framework-6

Popular Answer

What use does it serve to have a distinctPersonId if you just have one property in a class? That strikes me as poor form.

Maybe you only need a composite key." To use in in EF you can declare your class like this:

[Key, Column(Order = 0)]
public int column1 { get; set; }

[Key, Column(Order = 1)]
public int column2 { get; set; }
0
9/12/2016 2:27:34 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow