Dapper.FluentMap
3.5.0
dotnet add package Dapper.FluentMap --version 3.5.0
NuGet\Install-Package Dapper.FluentMap -Version 3.5.0
<PackageReference Include="Dapper.FluentMap" Version="3.5.0" />
<PackageVersion Include="Dapper.FluentMap" Version="3.5.0" />
<PackageReference Include="Dapper.FluentMap" />
paket add Dapper.FluentMap --version 3.5.0
#r "nuget: Dapper.FluentMap, 3.5.0"
#:package Dapper.FluentMap@3.5.0
#addin nuget:?package=Dapper.FluentMap&version=3.5.0
#tool nuget:?package=Dapper.FluentMap&version=3.5.0
FluentMap
English | Português (Brasil)
FluentMap is an advanced mapping layer for Dapper. It lets you describe how .NET object properties map to database columns with fluent, strongly typed code while keeping persistence attributes out of your POCOs.
FluentMap is not an ORM. It does not track entities, build arbitrary SQL, manage connections, run migrations, provide LINQ, or replace Dapper.
Project Status
Dapper.FluentMap is actively maintained. The maintained 3.x line continues the original project history while preserving the historical mapping model and adding newer capabilities as opt-in features.
Existing EntityMap<T> mappings and FluentMapper.Initialize(...) remain the compatibility baseline. Applications using normal root-level Dapper mappings generally do not need to rewrite working maps when upgrading from 2.x.
See MIGRATION.md when moving from FluentMap 2.x.
Key Capabilities
| Capability | Main API |
|---|---|
| Explicit property-to-column mapping | EntityMap<T>, Map(...).ToColumn(...) |
| Conventions and naming policies | AddConvention(...), UseNamingPolicy(...) |
| Immutable/factory construction | constructor mapping, ConstructUsing(...) |
| Nested objects and component value objects | QueryMapped* |
| Alternate SQL shapes | mapping profiles |
| Two/three-type multi-mapping | QueryMapped<...>(..., splitOn: ...) |
| Multiple result sets | QueryMultipleMapped*, ReadMapped* |
| Sync/async streaming | QueryMappedUnbuffered* |
| Per-property conversion | property converters |
| Generated registration/materialization | AddGeneratedMappings() |
| Strict generated path | UseStrictGeneratedMaterialization(), QueryGeneratedMapped* |
| Isolated configuration | FluentMapRuntime |
| Dependency Injection | AddFluentMap(...) |
| Dommel persistence/write conversion | InsertMapped*, UpdateMapped* |
| Compile-time diagnostics | FluentMap.Analyzers |
Detailed examples are in USAGE.md.
Installation
Install only the packages required by your application:
| Purpose | NuGet PackageId |
|---|---|
| Core | Dapper.FluentMap |
| Dommel integration | Dapper.FluentMap.Dommel |
| Dependency Injection | FluentMap.DependencyInjection |
| Roslyn analyzers | FluentMap.Analyzers |
| Source generators | FluentMap.Generators |
Core package:
dotnet add package Dapper.FluentMap
The FluentMap.* PackageIds are distribution identities only. Assemblies, namespaces and public APIs remain under Dapper.FluentMap.*.
Public packages target netstandard2.0. Supported dependency ranges and certified providers are documented in COMPATIBILITY.md.
Quick Start
using Dapper;
using Dapper.FluentMap;
using Dapper.FluentMap.Mapping;
public sealed class Customer
{
public int Id { get; set; }
public string Name { get; set; }
}
public sealed class CustomerMap : EntityMap<Customer>
{
public CustomerMap()
{
Map(customer => customer.Id).ToColumn("customer_id");
Map(customer => customer.Name).ToColumn("customer_name");
}
}
FluentMapper.Initialize(config =>
{
config.AddMap<CustomerMap>();
});
var customer = connection.QuerySingle<Customer>(
"SELECT 7 AS customer_id, 'Ada' AS customer_name;");
Call FluentMapper.Initialize(...) during application startup and treat the effective global configuration as read-only once queries begin.
For configuration validation:
FluentMapper.Validate();
Advanced Usage
Use FluentMap-controlled query APIs when mapping requires behavior beyond the historical root-level Dapper type map.
Examples include:
- nested objects and component value objects;
- profiles;
- two/three-type
splitOnmulti-mapping; - mapped multiple result sets;
- sync/async streaming;
- property converters;
- generated and strict generated materialization;
- isolated runtimes and DI;
- Dommel persistence metadata.
See USAGE.md for complete examples and API guidance.
Migrating From 2.x
The 3.x line preserves the main historical source-compatible mapping path.
If your application uses EntityMap<T>, FluentMapper.Initialize(...) and normal Dapper.Query<T>() calls for root-level mappings, migration is usually a package upgrade followed by configuration validation and application testing.
See MIGRATION.md for:
- the minimal migration path;
- Dapper and Dommel prerequisites;
- the
Ignore()/Dommel persistence review; - scenario-specific migration decisions;
- the migration checklist.
Compatibility
Compatibility claims are intentionally kept outside the README so they can evolve without duplicating release-sensitive details.
See COMPATIBILITY.md for:
- supported Dapper and Dommel ranges;
- provider certification;
- trimming and Native AOT boundaries;
- global-state limitations;
- unsupported environments and API boundaries.
Documentation
- Usage guide
- Migration from 2.x
- Compatibility
- Changelog
- Support
- Maintainer governance
- Português (Brasil)
Contributing
Keep changes small, compatible with the public API and covered by focused tests. Dapper.FluentMap.slnx is the preferred solution for current .NET SDKs; Dapper.FluentMap.sln remains available as a compatibility fallback.
Typical local validation:
dotnet restore ./Dapper.FluentMap.slnx
dotnet build ./Dapper.FluentMap.slnx --configuration Release --no-restore
dotnet test ./Dapper.FluentMap.slnx --configuration Release --no-build
When enabled, SonarQube Cloud participates in the CI quality gate. Repository-specific CI configuration is intentionally kept out of this README.
License
FluentMap is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Dapper (>= 2.1.79 && < 3.0.0)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.12)
NuGet packages (34)
Showing the top 5 NuGet packages that depend on Dapper.FluentMap:
| Package | Downloads |
|---|---|
|
Dapper.FluentMap.Dommel
Dommel integration for Dapper.FluentMap that configures Dommel table, key, generated-column, and persistence metadata through fluent mappings. |
|
|
ZKWeb.ORM.Dapper
Support use Dapper in ZKWeb. For more information please visit project site. |
|
|
EcommerceDataPostgresql
PostgreSQL Data Layer |
|
|
Hurb.SAP.Database
Package Description |
|
|
Dapper.Dommel
Simple CRUD operations for Dapper. |
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on Dapper.FluentMap:
| Repository | Stars |
|---|---|
|
zkweb-framework/ZKWeb
A flexible web framework supports .Net Framework and .Net Core
|
|
|
yorek/dapper-samples
Tutorial samples that shows how to use Dapper .NET
|
|
|
ardalis/DotNetDataAccessTour
A tour of different data access approaches in .NET 8+.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.5.0 | 0 | 10/1/2026 |
| 3.4.0 | 1,283 | 9/28/2026 |
| 3.0.3 | 8,875 | 9/10/2026 |
| 3.0.2 | 852 | 9/9/2026 |
| 3.0.0 | 1,024 | 9/8/2026 |
| 2.0.0 | 9,111,344 | 8/23/2020 |
| 1.8.1 | 995,967 | 5/5/2020 |
| 1.8.0 | 1,618,272 | 3/28/2019 |
| 1.7.0 | 496,486 | 11/16/2018 |
| 1.6.0 | 867,441 | 8/18/2017 |
| 1.5.4 | 16,238 | 8/17/2017 |
| 1.5.3 | 53,094 | 3/22/2017 |
| 1.5.1 | 95,954 | 7/7/2016 |
| 1.5.0 | 38,418 | 6/11/2016 |