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

Commented Issue: DbGeography that has no keys defined. [650]

$
0
0
I am hitting ModelValidationException when I use CodeFirst/DbModelBuilder to build my data model. One of my entities has DbGeography property. As long as I run the app, I will get the below exception:

One or more validation errors were detected during model generation:

\thttp://schemas.microsoft.com/ado/2009/11/edm.DbGeography: : EntityType 'DbGeography' has no key defined. Define the key for this EntityType.

I tried EF 5 and EF 6 apha1 and had the same issue.
Comments: Actually, playing a bit more with this I found that it is enough to do modelBuilder.Entity<DbGeography>(), even for an EDM version that does support spatial. Is it possible that your application is making this call somehow?

Viewing all articles
Browse latest Browse all 10318

Trending Articles