0

I have an MVC project with references to two seperate projects, each of which contains an edmx. Each of the two EDMX projects point to a different database. The two databases have tables with identical names - contacts for instance. I need both, sometimes in the same controller.

I've set up two different contexts, but I get the error "contact is an ambiguous reference between model1.contact and model2.contact.

How can I use two data contexts that have identical entity names?

6
  • How does your model namespace looks like? Commented Jun 20, 2014 at 15:11
  • The namespaces are just the name of the projects... Commented Jun 20, 2014 at 15:22
  • try to use fully qualified namespace and see what happens. if you hate too long namespace assign an alias for namespace Commented Jun 20, 2014 at 15:30
  • do you mean whenever I reference the entities in code? I would have to do that throughout my project...I hope there's another way. Commented Jun 20, 2014 at 15:34
  • If you have resharper then you might be able to do it faster :) But before that try full namespace in one place and see it that solves some of the error Commented Jun 20, 2014 at 15:36

1 Answer 1

1

try to use fully qualified namespace and see what happens. if you hate too long namespace assign an alias for namespace

Sign up to request clarification or add additional context in comments.

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.