Skip to content

Legacy Database Mapping

Required package: Dapper.FluentMap

Keep legacy column names outside the domain model.

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("CUST_NO");
Map(x => x.Name).ToColumn("LEGAL_NM");
}
}

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