Repository and Unit of Work Template

This template is designed for generating Repositories and Unit of Work for Entity Framework Core model. When adding this template to the model, the predefined EF Core 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 Entity Framework Core model.

Generate Memory Repository

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

Generate UnitOfWork Repository Properties

Determines whether to generate properties for getting each repository in the IUnitOfWork interface.

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. This property must be set to True when using the MVC Controller Template.

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.

Output

Data Access Layer Output

Specifies the output for the generated data access layer classes for Entity Framework Core 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.

Generate Parial

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.

Model Name As Files Prefix

Defines whether to add the model name to the generated file names as a prefix.

 


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.