FINALLY, I have found a resource that truly helps understand the content and usage of the .NET System.Data.Metadata.Edm namespace, which is essential in using EDMX entity models to generate code in Visual Studio 2012 using the Entity Model Designer and T4 templates.
Code First Code Generation
One of the issues I had hoped to solve with this knowledge is the generation of Code First fluent mappings for a model. Fortunately, someone has beat me to that. As a result, I can use their example to solve my final issue.
NHibernate 3 Fluent Mappings Generation
So if we already have all these cool answers for Entity Framework, why would we bother with NHibernate mappings? The answer lies in Microsoft Orchard and other .NET based CMS systems that use NHibernate as their data access technology. For our current projects at CloudMetal, this is a concern, since we have standardized on Orchard as our platform for delivering content along with general application functionality.
Leveraging the True Power of the Repository Pattern
A more academic reason to accomplish the task of working with multiple data access frameworks has to do with leveraging the true power of the Repository Architectural Pattern to make systems data technology agnostic. This is particularly important when ensuring that systems we build today will remain scalable with minimum development costs when, inevitably, system use over time reveals that changes must be made in how data is stored. A common theme today is web-based systems is the need to move from RDBMS technologies to NoSQL technologies for some parts of a system when the user count grows dramatically. A properly implemented Repository Pattern can ensure minimum of costs and pain when such a transition is proven necessary.
Some Other Resources
Dan Wahlin wrote a template that inserts data annotations into generated classes, so there is not a need for “buddy” classes to describe validation rules.