5

Can we create multiple entity framework in project for the same database? I want to create entity framework for each subsystem. Some of subsystem have shared table.

1
  • You mean you want to create multiple conceptual data models on top of that database? Yes, that's absolutely possible. Have you tried it? If so: did you have any problems/issues? If yes: what problems/issues?? Commented Aug 22, 2012 at 4:52

1 Answer 1

6

It's possible, and you can create multiple EDMX files as you wish.

But it's not recommmended, as...

  1. You can not query multiple tables in different models.
  2. Defining boundary will be very difficult because mostly tables are connected through relationships.
  3. If same table exists in multiple models, then you will have consistency issues and namespace clashes.

Instead, we created only one EDMX model and put it in a common library, which is then imported in many different sub projects.The only problem is, your connection string has to be defined correctly specifying common library resources.

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.