简体   繁体   中英

Property type of 'System.Data.Entity.Spatial.DbGeography' which cannot be mapped to a primitive type

Updated from EF 5.0 to 6.2 (designer from database) and getting the error:

Schema specified is not valid. Errors: The relationship 'CWPP.FK_Coordinates' was not loaded because the type 'CWPP.Coordinate' is not available. The following information may be useful in resolving the previous error: The property 'geo' on the type 'CWPP.Data.Coordinate' has a property type of 'System.Data.Entity.Spatial.DbGeography' which cannot be mapped to a primitive type.

I've followed the the steps here: Upgrading to Entity Framework 6

Stack overflow question here: Schema specified is not valid. Errors: 'System.Data.Spatial.DbGeography' which cannot be mapped to a primitive type

and read through the other related questions / answers on stack overflow. I've also tried completely deleting the entity model and recreating it, but still the same error. It seems like it's still trying to reference EF 5.0 but 6.2 is all that's installed. The reference to System.Data.Entity has been removed.

在此处输入图片说明

Any advice would be appreciated. Thanks.

We finally figured out what our problem was. I'll post hoping it may help someone else. We were using Entity Data Source with a few of our controls and this is no longer supported with EF 6.

Here's the corresponding stack overflow Q/A that helped us: EntityDataSource and Entity Framework 6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM