4

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?

2 Answers 2

2

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:

  1. Install EF6
  2. Update any namespace/using statements
  3. Remove references to System.Data.Entity
  4. (Probably) refresh your EF diagram.
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks,this helped.. exactly the step 3 at msdn.microsoft.com/en-US/data/dn469466
-1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.