Connect properties and columns through a clear API.
Dapper FluentMap documentation
Dapper FluentMap · .NET
Map your data. Keep your models clean.
Add fluent, strongly typed mapping to Dapper without persistence attributes in your POCOs. FluentMap complements Dapper; it does not replace Dapper or aim to become a full ORM.
public sealed class CustomerMap
: EntityMap<Customer>
{
public CustomerMap()
{
Map(x => x.Id)
.ToColumn("customer_id");
Map(x => x.Name)
.ToColumn("customer_name");
}
}Explicit mapping where it helps
A small, predictable layer between your objects and the names exposed by the database.
C# expressions keep mappings close to the compiler.
Keep persistence attributes out of your domain.
Apply repeatable rules and naming policies.
Materialize constructors and factories on supported paths.
Keep using Dapper connections, SQL, and queries.
Register mappings and supported materializers at build time.
Validate configuration at runtime and with optional analyzers.
From model to query in three files
This example uses verified core-package APIs. Switch tabs, copy a file, and continue with the full guide.
public sealed class Customer
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
}public sealed class CustomerMap : EntityMap<Customer>
{
public CustomerMap()
{
Map(x => x.Id).ToColumn("customer_id");
Map(x => x.Name).ToColumn("customer_name");
}
}FluentMapper.Initialize(config =>
config.AddMap<CustomerMap>());
var customer = connection.QuerySingle<Customer>(
"SELECT customer_id, customer_name FROM customers");Built for real systems
Use FluentMap when the database schema and application model need to evolve with separate responsibilities.
Legacy databases
Map old column names without changing your entities.
Different conventions
Bridge PascalCase, snake_case, and schema-specific names.
ASP.NET Core
Use isolated configuration and DI integration.
Multiple providers
Keep mapping above the ADO.NET provider layer.
Choose your next step
The documentation progresses from your first mapping through materialization, integration, and migration.
Help FluentMap get even better.
Report bugs, propose improvements, share examples, or contribute code and documentation. If the project helps your work, a star makes it easier for other developers to find.