April 18, 2013 13:06
Discovered a cool feature in EF5. You can create multiple Edmx models in one .NET project. You can now create multiple domains with separate domain models within the same assembly. Up to now, I had one large Edmx file with all the required db objects for all my repositories and also only in one color. I am no longer forced to create multiple domain assemblies.
Here an example for my business domain:

And another domain for my diagnostics…

With this I can separate domains as I wish. For example, configuration data could be loaded per application lifecycle, or business entities can be load per web request…
If I mix this with the repository pattern, use an IoC, I have the basis for a solid backend tier of an application which can remain readable with large database schemas.
here’s source code of a simple hello world example:
git@github.com:damienbod/EF5DomainTest.git
Posted by damienbod
Categories: .NET, Entity Framework, SQL
Tags: Entity Framework EF .NET SQL database
Mobile Site | Full Site
Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.
Do you mind if I quote a couple of your posts as long as I provide
credit and sources back to your webpage? My blog site
is in the exact same niche as yours and my visitors would definitely benefit
from a lot of the information you present here.
Please let me know if this ok with you. Many thanks!
By Alex on April 27, 2013 at 15:24
No Problem
By damienbod on April 29, 2013 at 09:37