Does anybody know of a guide on migration to 0.4 to 2.0 version using
ITypeConverter ?
The ITypeConverter interface has been changed to have a "TDestination
Convert(ResolutionContext context)" instead of "TDestination
Convert(TSource source)" for the Convert method.
http://automapper.codeplex.com/wikipage?title=Custom%20Type%20Converters
In my code, now I get this error:
'BusinessFacade.Mappers.DecimalToNullableInt' does not implement
interface member
'AutoMapper.ITypeConverter.Convert(AutoMapper.ResolutionContext)'
Any good full sample for new mapper like my mappers ? I don't want
change any code (or minimum code) in my projects...
My mapper now, I need "migrating.."
public class DecimalToNullableInt : ITypeConverter<decimal, int?>
{
public int? Convert(decimal source)
{
if (source == 0)
return null;
return (int)source;
}
}
I'm sure there are many more things which should be taken into
consideration so I'm hoping that an AutoMapper expert has written up
something, somewhere, that I can leverage.
http://automapper.codeplex.com/wikipage?title=Custom%20Type%20Converters
https://github.com/AutoMapper/AutoMapper/wiki/Custom-type-converters
The ITypeConverter interface has been changed to have a "TDestination
Convert(ResolutionContext context)" instead of "TDestination
Convert(TSource source)" for the Convert method.
Thanks.