0

I have been tasked with designing a data access layer that will connect to tables with interchangable schemas(used for permissions and separation). The database itself may different each call as well (because of business rules). I plan on using Entity Framework 4.3(all existing apps that will use this are already using Entity Framework) with POCO classes (to prevent multiple dev's from accidently using the model generator against something that's customized) and DbContext (so effectively Compact Framework without the code generating). I plan on utilizing DbModelBuilder and EntityConnectionStringBuilder to achieve these dynamic situations. Anyone done this or have a better solution?

Community
  • 1
  • 1
YurikoEX
  • 105
  • 2
  • 9

1 Answers1

0

There are extensions for visual studio that will auto generate POCO's using t4 templates. There are also T4 templates for auto generating the repositories and the associated interfaces. These options also have the ability to add options that make it easier for working with WCF. Here is the visual studio extension link.

http://visualstudiogallery.msdn.microsoft.com/ff781f46-d8c3-45e0-a545-40906921bb86

This extension automatically updates the poco classes if the .edmx resides in the same namespace. Options for changing the name space or project and separating the poco's into a project separate from the DAL is achievable but you must tell the poco's to look for changes.

I hope that answers your question. It is doesn't then I can take another stab at it with some additional context.

danmanallen
  • 175
  • 3
  • 14