Skip to content

Migrating from 1x

Sanam edited this page Oct 7, 2026 · 1 revision

The call is the same: Mapper.Map<TInput, TOutput>(input). Code that compiled against 1.x compiles against 2.0, as long as the project targets .NET 10.

Requirements

1.x 2.0
Target framework net7.0 net10.0
SDK .NET 7 or later .NET 10

Results that change

2.0 copies fewer properties in three cases. Each one was a bug in 1.x.

Case 1.x 2.0
Target property with a private, internal or protected setter Written Not written
Source property without a public getter Read, or threw Skipped
Indexer on either type Threw Ignored

If you relied on a private setter being written, make it public or init.

Speed

1.x rebuilt and compiled its mapping on every call, so each call took about 180 µs. 2.0 runs generated code at hand-written speed, about 13 ns for a 10-property class. See the benchmarks.

The full list of changes is in the changelog.

Clone this wiki locally