Link Search Menu Expand Document

TypeMapFluentDefinition


A class that is being used to define a type level mappings for the database types and property handlers. It is the result of the Type() method of the FluentMapper mapper class.

The mapping will be applied (at the least) to all data entity properties with the same .NET CLR type. So please be reminded of this.

Mapping a Database Type

To map an equivalent database type into a .NET CLR type, use the DbType method.

var definition = FluentMapper.Type<DateTime>();
definition.DbType(DbType.DateTime2);

It is using the TypeMapper class underneath.

Defining a Property Handler

To define the property handler for the data entity property, use the PropertyHandler method.

var definition = FluentMapper.Entity<DateTime>();
definition.PropertyHandler<DateTimeToUtcKindTypeHandler>();

It is using the PropertyHandlerMapper class underneath.