So, I'm using Entity Framework and need to now how set my own primary key.
Im using the [Key] data annotation but when I persist the entity that field is autogenerated even having that I previously set that property.
Any idea?
I believe that in your [Key] Attribute you need to specify the DatabaseGeneratedOption as follows:
[Key, DatabaseGenerated(DataBaseGeneratedOption.None)]