You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.
I used to write my mappings manually until I started to use AutoMapper.
Preventing me from having to write mapper code wasn't what saved me lots of time though, it was the fact that I could validate that no members have been missed.
Do you have something to cater for ensuring the mappers are up to date with the target and source classes?
The text was updated successfully, but these errors were encountered:
For validation in design time, if all members of the target object are assigned, you can use my another extension which is described here Immutable types in C# with Roslyn - this can be solved with [InitRequire] attribute or /*FullInitRequired*/ marker.
For runtime validation - you can use tools like https://github.com/approvals/ApprovalTests.Net to create easy to maintain unit tests without the need to hardcode the assertions for all target members.
I used to write my mappings manually until I started to use AutoMapper.
Preventing me from having to write mapper code wasn't what saved me lots of time though, it was the fact that I could validate that no members have been missed.
Do you have something to cater for ensuring the mappers are up to date with the target and source classes?
The text was updated successfully, but these errors were encountered: