Skip to content

Mapping Graphs (DTO to DTO)

Leonardo Porro edited this page Jan 30, 2023 · 8 revisions

Replacing awesome products like AutoMapper or TinyMapper is not the goal of this library, however small plain class to class (i.e.: DTO to DTO) mapping can be done by accessing DbContext mapper or creating your own mapper instance.

Access DbContext mapper and call Map

Profile key can be passed as a parameter to GetMapper method.

dbContext.GetMapper().Map<SourceDTO, TargetDTO>(sourceDTO, targetDTO);