Reputation: 41
I'm doing Entity Framework (v6) db first. I get the following error when trying to access data from my datacontext. The relationship 'Model.FK_Table1_Table2' was not loaded because the type 'Model.Table1' is not available. The following information may be useful in resolving the previous error: The property 'Location' on the type 'Model.Table1' has a property type of 'System.Data.Spatial.DbGeography' which cannot be mapped to a primitive type.
Any idea what is causing this error?
Upvotes: 4
Views: 1685
Reputation: 31
Probably you need to see the solution on this url https://msdn.microsoft.com/en-US/data/dn469466
I have fixed same problem after updating some content of my code from mentioned url page there they have given solution for update to EF-5 to EF-6 after updating some of references on my context class. it is working fine.
Upvotes: -1
Reputation: 2283
I don't know if this is your problem, but I had a similar error when I upgraded from EF5 to EF6. The spatial data types moved namespaces. This link has all the info:
http://msdn.microsoft.com/en-US/data/dn469466
Boiled down, you need to:
Upvotes: 2