Implicit Mapping
Attribute-free mapping for class names, columns, keys, and types, configured entirely through mapper classes.
Entity-based Mapping
For entities you’d rather not decorate with attributes, FluentMapper configures the table name, keys, columns, database types, and handlers in one chained call.
FluentMapper
.Entity<Customer>()
.Table("[sales].[Customer]")
.Primary(e => e.Id)
.Identity(e => e.Id)
.Column(e => e.FirstName, "[FName]")
.ClassHandler<CustomerClassHandler>()
.PropertyHandler<CustomerAddressPropertyHandler>(e => e.Address);
Type-based Mapping
To configure a .NET CLR type once instead of per-entity, use FluentMapper’s Type() method — it maps the database type and property handler for every property of that type, across all entities.
FluentMapper
.Type<DateTime>()
.DbType(DbType.DateTime2)
.PropertyHandler<DateTimeToUtcKindTypeHandler>();
Type-level mappings apply to all data entity properties of the same type.
The individual mappers
FluentMapper is a wrapper over dedicated mapper classes — ClassMapper, IdentityMapper, PrimaryMapper, PropertyMapper, TypeMapper, ClassHandlerMapper, and PropertyHandlerMapper — each with its own Add(), Get(), and Remove() methods, usable directly when you only need to touch one concern.
Removing a mapping
Every mapper’s Remove() reverses its own Add(). For hot paths, prefer the matching cache class (ClassMappedNameCache, IdentityCache, PrimaryCache, and so on) over calling Get() repeatedly, since the cache avoids re-resolving the same mapping on every call.