Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 1.46 KB

runtime-isolation.md

File metadata and controls

43 lines (27 loc) · 1.46 KB
title Runtime Isolation
description Keep mapping configuration local instead of mutating global Dapper state.
Home/Advanced Mapping/Runtime Isolation

Required package: Dapper.FluentMap

Problem solved

Keep mapping configuration local instead of mutating global Dapper state.

When to use it

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

Example

var runtime = new FluentMapConfigurationBuilder()
    .AddMap<CustomerMap>()
    .Build()
    .CreateRuntime();

var customer = runtime.QueryMappedSingle<Customer>(connection, sql);

How it works

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

Constraints

:::caution Initialize before concurrent queries and treat the effective configuration as read-only afterward. :::

Related references