1

I created a PersonInsertDto which inherits from PersonDto so that I could perform a unique mapping for inserts.

So my class looks like public class PersonInsertDto : PersonDto

I setup a profile with CreateMap<PersonInsertDto, Person>(), which maps differently than my profile CreateMap<PersonDto, Person>()

This works perfectly when converting from PersonInsertDto to Person. However, my insert profile is also being ran when converting from the plain PersonDto to Person.

How can I make sure that AutoMapper only runs the PersonDto => Person profile?

AutoMapper version 6.2.2.0

stackoverfloweth
  • 6,669
  • 5
  • 38
  • 69
  • Possible duplicate of [Using Profiles in Automapper to map the same types with different logic](https://stackoverflow.com/questions/2183401/using-profiles-in-automapper-to-map-the-same-types-with-different-logic) – mxmissile Feb 13 '19 at 19:06

0 Answers0