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.
-
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??marc_s– marc_s2012-08-22 04:52:16 +00:00Commented Aug 22, 2012 at 4:52
Add a comment
|
1 Answer
It's possible, and you can create multiple EDMX files as you wish.
But it's not recommmended, as...
- You can not query multiple tables in different models.
- Defining boundary will be very difficult because mostly tables are connected through relationships.
- 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.