Fluent Mapping Template

This template is designed for generating a strongly-typed DataContext class, fluent mapping and classes with persistence ignorance. This template is available in C# only.

This template has the following properties:

Fluent Mapping

Database Independent

If this property is set to False (default value) and fluent mapping is used, database-specific types for entity properties and complex type properties are included to the generated code. Otherwise, the provider determines database specific types automatically and the same code can be used for different databases. Acceptable values are True or False.

Disabled Conventions

Allows you to disable Code-First configuration conventions. Acceptable values are:

0

This value indicates that no conventions are currently disabled.

BinaryPropertyConvention

Sets facets (MaxLength, IsNullable and IsFixedLength), if any of them are not defined for binary type properties (byte[] and Devart.Data.Linq.Binary).

CreateAssociationConvention

Creates associations between entities, if they have navigation properties of the corresponding types.

CreateTablePerTypeInheritanceConvention

If entities have child classes, but inheritance is not defined explicitly in the LinqConnect model, TPT hierarchy is built on their basis.

DateTimePropertyConvention

Sets facets (Scale), if any of them are not defined for properties of the DateTime type.

MapPropertiesConvention

Maps unmapped properties of primitive and complex types automatically, unless these properties are explicitly set to be ignored.

MapTablesConvention

Maps unmapped entity types and their descendants automatically, looks for these entity types by properties of the Table<TEntity> type of DataContext.

NumberPropertyConvention

Sets facets (Precision, Scale), if any of them are not defined for numeric type properties.

PrimaryKeyConvention

If an entity has no primary key, then it is set as follows:

if an entity has an 'id' property, then is is defined as the primary key;
if an entity has exactly one property of the Guid type, then is is defined as the primary key;
if nothing is found, then all properties are defined as primary keys.

PropertyNameConvention

If the column name is not specified explicitly for a property, then this name is composed on the basis of the default naming rules.

PropertyOrderConvention

Defines column order in a mapped table.

TableNameConvention

Sets the table name, if it is not specified explicitly.

ServerDataTypeConvention

Looks for the appropriate data type (in the database) for the column, if this type is not specified explicitly.

SetAssociationOtherSideConvention

If a navigation property is mapped at one association end only, tries to map the other one.

StorageConvention

Naming rule of the field that corresponds to the particular entity property.

StringPropertyConvention

Sets facets (MaxLength, IsNullable, IsUnicode and IsFixedLength), if any of them are not defined for properties of string types.

UpdateCheckConvention

Sets UpdateCheck for entity properties, that don't have it specified explicitly (sets UpdateCheck.Always).

Property Changing Notification

If it is set to True, each model class will implement the INotifyPropertyChanging and INotifyPropertyChanged interfaces. Acceptable values are True or False.

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

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.)

Use Compiled Query Cache

If it is set to False, the compiled query cache will be disabled for the generated context class.

Output

Context Output

Specifies output for the generated context.

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.

Entities Output

Allows specifying the output folder for the generated entity classes. The value of this property is taken into account during generation only if the File Per Class property is set to True.

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.

File Per Class

Defines whether each model class will be placed into a separate file when generating code. Acceptable values are True or False.

Generate Partial Class

Defines whether for each class of the model a partial class will be generated, in which it will be possible to add code that won't be overwritten by the designer. The property can be used, if File Per Class is set to True. Acceptable values are True or False.

Model Name As Files Prefix

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

Validation

Validation Error Messages

Specifies error messages to associate with a validation control if validation fails. If you do not want to use hardcoded error messages (e.g. for the sake of internationalization), you can use error messages stored in the application resources. For this, specify the name of the resource type for error messages in the following format: ResourceType=<type name>. Additionally, the resource name for your error message for the corresponding validator must be equal to the name of a property from the ValidationErrorMessages property.

Email Message

Specifies the error message to associate with a validation control if email validation fails.

Expression Message

Specifies the error message to associate with a validation control if regular expression validation fails.

IPAddress Message

Specifies the error message to associate with a validation control if IPAddress validation fails.

Length Message

Specifies the error message to associate with a validation control if length validation fails.

Numeric Message

Specifies the error message to associate with a validation control if numeric validation fails.

Range Message

Specifies the error message to associate with a validation control if range validation fails.

Required Message

Specifies the error message to associate with a validation control if required validation fails.

Validation Framework

Defines the set of attribute types and its source to be used for validating the property values of generated classes. Acceptable values are EnterpriseLibrary, NHibernateValidator, DataAnnotations, None.

 


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.