Skip to content

Trimming and Native AOT Limitations

Required package: Dapper.FluentMap

Use explicit or generated paths without claiming complete AOT support.

Use this capability when the column shape and .NET model should remain separated by explicit, reviewable configuration.

public sealed class CustomerMap : EntityMap<Customer>
{
public CustomerMap()
{
Map(x => x.Id).ToColumn("customer_id");
Map(x => x.Name).ToColumn("customer_name");
}
}

FluentMap registers typed metadata and applies it through the matching materialization path. SQL, connections, parameters, and lifecycle remain responsibilities of the application and Dapper.

Ordinary runtime materialization may use reflection, expression compilation and Dapper fallback; it is not the certified Native AOT path. Generated materialization normally may also fall back. The validated Native AOT boundary is strict-generated SQLite with generated registration/materializers, explicit GeneratedParameters, safe column reordering/additions, property converters, nullable DateOnly/TimeOnly and deterministic rejection of unsupported shapes.

Dapper 2.1.89 suppresses selected IL diagnostics in upstream runtime fallback code. Suppression alone does not establish universal Native AOT compatibility for Dapper or FluentMap. Assembly scanning, convention-only discovery, arbitrary parameter objects, reflective TypeHandler interop and delegate construction strategies remain outside the strict-generated claim.