0

Given the following example:

class Source:
int Id;
DateTimeOffSet StartDate;
DateTimeOffSet EndDate;
...

class Destination:
int Id;
DateTimeOffSet StartDate;
DateTimeOffSet StartDateUtc;
DateTimeOffSet EndDate;
DateTimeOffSet EndDateUtc;
...

How can I map both ways all source properties of type DateTimeOffSet of all my objects from/to their destination properties with the -Utc suffix? (the destination property without the suffix should stay unmapped)

Żubrówka
  • 730
  • 1
  • 10
  • 24
  • http://docs.automapper.org/en/latest/Configuration.html#recognizing-pre-postfixes – Lucian Bargaoanu Dec 11 '19 at 15:11
  • @LucianBargaoanu can't get it to work destination -> source; AM uses Destination.StartDate instead of Destination.StartDateUtc (tried RecognizePostfixes/RecognizeDestinationPostfixes) – Żubrówka Dec 12 '19 at 08:21
  • These things can be tricky. You can check the tests in the repo to get a better feel about how to use them. – Lucian Bargaoanu Dec 12 '19 at 09:13

0 Answers0