/EntityModelCodeGenerator

Code generation for Entity Model [archival]

Primary LanguageVisual Basic .NET

EntityModelCodeGenerator

Code generation for Entity Model [archival]

This is an old project of mine, that I created back in 2008.
Imported into GitHub for archival puposes only.
There will be no updates.

Introduction

For most part of the last year (2008) I've been developing code using the ADO.NET Entity Framework, which sure is a very nice way to approach data driven applications.

However, as good as the Entity Framework is, it's far from perfect, specially when you start dealing with Web Services too.

For instance, when you create a web method that returns an instance of an entity, the XML generate is too complex, creating a lot of intermediate classes that has no purpose, or function. Those classes are created only because of the entity class inheritance hierarchy.

Taking the SampleEdmxCodeGenerator as the start point, I developed a code generator that create simple classes for each entity and the the appropriated converters.

For the code generation, it uses the EntityClassGenerator that handles all the entity classes creation, and uses the CodeDom to create the simple classes and the converters.

The namespace for the entities are specified by the Custom Tool Namespace property of the file. If not informed it uses the RootNamespace for VB projects and the Entity namespace for C# projects.

The simple classes are created on a sub-namespace SimpleClasses, and the converters in a sub-namespace Converters.