Search code examples
asp.net-mvc-3entity-frameworkentity-framework-4.1asp.net-mvc-3-areas

Is it good to have multiple EF models in one application


We are using MVC3 and EF in our application. We are following Database First approach.

We are in the initial stage of or project. As of now we are thinking of having multiple EF models (generate from DB) in our application.

Like for each module we are thinking of generating a model with the related tables and use that table in that module.

May be in some models we may have some common table like reference data (example countries list).

By doing this will there be any performance impact?

Thanks.


Solution

  • Actually it is better to have multiple smaller EF models in an application as opposed to one larger model. You can run into performance problems if the model is very inter connected.

    See this article for more information: http://www.codeproject.com/Articles/38922/Performance-and-the-Entity-Framework