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.
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: