It looks like an IValueFormatter
takes a value of type object
and returns a value of type string
, while a ValueResolver<TSource, TDestination>
takes a value of any type and returns a value of any type. So, it's more flexible. There is also the matter that, with a ValueResolver
, you never need to cast the source to a particular type--you define it explicitly in your class definition.
Given this, why use IValueFormatter
? Does it do anything that can't be done with ValueResolver
? Am I misunderstanding how it works?