Available Presets

For Entity Framework v5 and v6, the following presets are available. Every preset generates all entity classes, typed list row classes, typed view row classes and value type classes in separate files and adds proper XML comments to the generated code.

All presets generate a DbContext class called ProjectNameDataContext, unless the setting SetContextClassNameEqualToEdmxModelContainerName is set to true, the context class is then called ProjectNameEntities.

The presets are similar to the Proxy friendly POCO entities for Entity Framework v4, however instead they generate a DbContext using context class, and plain classes for entities, no tracking code whatsoever is added as it's not required.

All presets generate two VS.NET projects. The first VS.NET project, called RootNamespace.Model and located in the Model folder, contains the entity classes, value type classes, typed list row classes and typed view row classes.

The second VS.NET project, called RootNamespace.Persistence and located in the Persistence folder, contains the DbContext class and either the EDMX file (DbContext API preset) or the ModelBuilder class (Code First preset).

For Entity Framework v6

  • SD.EntityFramework.v6 (DbContext API). This is the default.
  • SD.EntityFramework.v6 (Code First). This preset generates a ModelBuilder class instead of an EDMX file, for code first support.

For Entity Framework v5

  • SD.EntityFramework.v5 (DbContext API)

Compiling and using the generated code

To use both generated VS.NET projects in your own solution, be sure that the RootNamespace.Persistence VS.NET project references the RootNamespace.Model VS.NET project. For Entity Framework v5, the generated code will reference the Entity Framework assembly shipped with VS.NET.

For Entity Framework v6, in the RootNamespace.Persistence VS.NET project you have to add a reference to the Entity Framework v6 assembly available on nuget. This will make sure you'll reference the Entity Framework version matching the .NET version you're targeting.