Repository and Unit of Work Template

This template is designed for generating Repositories and Unit of Work for NHibernate model. When adding this template to the model, the predefined NHibernate template is added automatically, as the Repository and Unit of Work template is only an additional template and does not generate itself classes for entities and mapping. This template is available both in C# and Visual Basic.

Repository and Unit of Work template has the following properties:

General

Description

Description of the template.

Enabled

Indicates whether the template is enabled. Acceptable values are True or False.

File Name

The name of the template file.

Name

The name of the template.

Type

The type of the template.

Generation

Data Access Layer Namespace

Specifies the namespace for the generated data access layer classes for NHibernate model.

Generate Memory Repository

If the value is set to True, the MemoryRepository class code will be generated.

Generic Repository Pattern

Defines whether to generate the implementation of the generic repository pattern and IRepository<T> and whether the IRepository<T> interface will contain the method returning IQueryable<T>. No separate interface and repository class will be generated for entities.

Header Timestamp Version Control Tag

Setting this option will replace the standard date/time stamp in the file header with the specified tag (e.g. a version control tag for Subversion, Git, etc.)

Interface Layer Namespace

Specifies the namespace for the generated interface layer classes.

NHibernate

Fluent Session Provider

If the value is set to True, the generated NHibernateSessionProvider will use FluentNHibernate when creating a session.

Generate Session Provider

If the value is set to True, the NHibernateSessionProvider class code for creating a default NHibernate session will be generated.

Output

Data Access Layer Output

Specifies the output for the generated data access layer classes for NHibernate model.

Project

(This property is available in the Visual Studio add-in only) The name of the Visual Studio project where the generation result will be located.

Project Folder

(This property is available in the Visual Studio add-in only) The name of the directory in the Visual Studio project where the generation result will be located.

Destination Folder

(This property is available in the standalone application only) The directory to contain the generation results.

Generate Partial

If the value is set to True, then for each repository interface and class, in case of non-generic repository pattern implementation generation, a partial interface and class will be generated, in which the user can add code that is not overwritten by the designer.

Interface Layer Output

Specifies the output for the generated interface layer classes.

Project

(This property is available in the Visual Studio add-in only) The name of the Visual Studio project where the generation result will be located.

Project Folder

(This property is available in the Visual Studio add-in only) The name of the directory in the Visual Studio project where the generation result will be located.

Destination Folder

(This property is available in the standalone application only) The directory to contain the generation results.

 


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.