Model template types

This section describes the types of templates in Entity Developer.

Predefined templates

Entity Developer includes a set of predefined templates. These templates cannot be edited, however, you can create custom templates (see below) based on predefined ones. The following templates are added to the Entity Developer application by default:

  • Entity Framework:
    • EntityObject – Generates a strongly-typed ObjectContext class and persistence-aware classes.
    • POCO Entity – Generates a strongly-typed ObjectContext class and classes with persistence ignorance.
    • Self-Tracking Entity – Generates a strongly-typed ObjectContext class and self-tracking entity classes.
    • DbContext – Generates a strongly-typed DbContext class, persistence ignorant entity classes, and fluent mapping code for them.
    • Repository and Unit of Work – Generates Repositories and Unit of Work classes.
    • Data Annotations Metadata – Generates Data Annotations metadata classes and decorates entity classes and properties with Data Annotations attributes that specify validation rules, data display settings, and define metadata for Windows Communication Foundation, Dynamic data, and WCF RIA Services.
    • Data Transfer Objects – Generates Data Transfer Object (DTO) classes.
    • WCF RIA Domain Service – Generates a WCF RIA Services domain service class.
    • MVC Controller – Generates a ASP.NET MVC controller with data access code.
    • MVC View Advanced – Generates an ASP.NET MVC view based on Twitter Bootstrap.
  • Entity Framework Core:
    • EF Core – Generates classes for entities, enumerated types for enums, and it also generates fluent mapping for them.
    • Repository and Unit of Work – Generates Repositories and Unit of Work classes.
    • Data Annotations Metadata – Generates Data Annotations metadata classes and decorating entity classes and properties with data annotation attributes.
    • Data Transfer Objects – Generates Data Transfer Object (DTO) classes.
    • MVC Controller – Generates a ASP.NET MVC controller with data access code.
    • MVC View Advanced – Generates a ASP.NET MVC view based on Twitter Bootstrap.
  • LINQ to SQL:
    • LINQ to SQL – Generates a strongly-typed DataContext class and persistence-aware classes.
    • POCO Entities – Generates a strongly-typed DataContext class and classes with persistence ignorance.
    • LINQ to SQL for Windows Phone – Generates a strongly-typed DataContext class and persistence-aware classes for Windows Phone applications.
    • Repository and Unit of Work – Generates Repositories and Unit of Work classes.
    • Data Annotations Metadata – Generates Data Annotations metadata classes and decorates entity classes and properties with Data Annotations attributes that specify validation rules, data display settings, and define metadata for Windows Communication Foundation, Dynamic data, and WCF RIA Services.
    • Data Transfer Objects – Generates Data Transfer Object (DTO) classes.
    • WCF RIA Domain Service – Generates a WCF RIA Services domain service class.
    • MVC Controller – Generates a ASP.NET MVC controller with data access code.
    • MVC View Advanced – Generates an ASP.NET MVC view based on Twitter Bootstrap.
  • NHibernate:
    • NHibernate – Generates NHibernate classes with XML mapping.
    • Fluent NHibernate – Generates Fluent NHibernate Mapping classes.
    • Castle ActiveRecord – Generates Castle ActiveRecord classes.
    • Repository and Unit of Work – Generates Repositories and Unit of Work classes.
    • Data Annotations Metadata – Generates Data Annotations metadata classes and decorates entity classes and properties with Data Annotations attributes that specify validation rules, data display settings, and define metadata for Windows Communication Foundation, Dynamic data, and WCF RIA Services.
    • Data Transfer Objects – Generates Data Transfer Object (DTO) classes.
    • MVC Controller – Generates a ASP.NET MVC controller with data access code.
    • MVC View Advanced – Generates an ASP.NET MVC view based on Twitter Bootstrap.
  • Telerik Data Access:
    • Data Access – Generates classes for entities and complex types, enumerated types for enums, and it also generates fluent mapping for them.
    • Repository and Unit of Work – Generates Repositories and Unit of Work classes.
    • Data Annotations Metadata – Generates Data Annotations metadata classes and decorates entity classes and properties with data annotation attributes.
    • Data Transfer Objects – Generates Data Transfer Object (DTO) classes.
    • MVC Controller – Generates a ASP.NET MVC controller with data access code.
    • MVC View Advanced – Generates a ASP.NET MVC view based on Twitter Bootstrap.

Custom templates

At some stage, the capabilities of the existing templates might seem insufficient and you may want to create new templates based on the blank template, or a predefined one. To use the blank template as a basis, right-click the Templates node of the Model Explorer window and select New Blank Template. To use a predefined template as a basis for a custom template, right-click the required template in the Templates node of the Model Explorer window and select Copy to Model Folder. Unless shared, templates of this type can be used only for a particular model.

Note

Prior to adding a predefined template with the Copy to Model Folder context menu option enabled, ensure that your model has been saved first. It is impossible to copy a template to an unsaved model.

Custom (or user-defined) templates can be easily made shared using the Make Shared context menu option. This allows using custom templates in other models. Shared templates are marked as Shared by the corresponding value of the Type property in the Properties window, and in the list of templates in the Add Template dialog. Shared templates and are stored in the C:\ProgramFiles\Common Files\Devart\EntityDeveloper\Shared Templates folder.

See also

  • Basic operations With templates
  • Working with templates
  • Entity framework model generation templates
  • NHibernate model generation templates