I am still confused of when to use Value Formatter versus Value Resolver in automapper.
Say I have a nullable DateTime that I want to make into a specific date format(so the end result would be a string). Should I use Formatter in this case?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I had the same question and chose Value Resolver based upon documentation from the author himself that Value Formatter is likely a design mistake:
https://github.com/AutoMapper/AutoMapper/wiki/Custom-value-formatters
However, that same author provided a response to what to use when here:
Why does AutoMapper have an IValueFormatter when it has a seemingly much more powerful ValueResolver?