Series: Automapper Madness

5 posts in this series

Series: Automapper Madness

Getting started with AutoMapper in C#: unit testing your maps, self-mapping nuances, ReverseMap and configuration validation, and deciding when AutoMapper is the right tool.

  1. Automapper Madness
    August 10, 2022

    How to set up AutoMapper in a C# solution with a factory class and an Autofac module, and why keeping mapping logic simple makes your code easier to test.

  2. Automapper Madness
    August 16, 2022

    AutoMapper maps are easy to unit test. Use AssertConfigurationIsValid, regression tests, and a reusable base test class to verify mappings with less …

  3. Automapper Madness
    September 13, 2022

    AutoMapper lets you map a type to itself without creating a map, but it returns the same instance instead of a copy. Here's how to force a real copy and test …

  4. Automapper Madness
    December 12, 2022

    AssertConfigurationIsValid skips ReverseMap configurations in AutoMapper. Fix it with two distinct mappings or ValidateMemberList, and know when to use each.

  5. Automapper Madness
    August 20, 2024

    AutoMapper isn't the tool for every scenario, but what is done in these more complex cases? Is AutoMapper still useful when more complexity is present?