Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Issue: Custom key conventions are not compatible with the [Key] annotation [647]

$
0
0
Situation: there is a custom convention that identifies a property in an entity as the primary key and there exists a [Key] annotation that specifies a different property within that entity we receive an exception reading: <br />"Unable to determine composite primary key ordering for type 'ConflictingLightweightConventions.Post'. Use the ColumnAttribute or the HasKey method to specify an order for composite primary keys."<br /><br />this happens even if they convention specifies a index for the added key i.e. (c => c.IsKey(2))<br />we need to define a way for the key annotation to be compatible with key conventions

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>