IValueResolver won't work with AutoMapper
Hi guys , hope all of you doing well,
I'm recently working on a project where I need to convert a special type of values to
Datetime
as the following example :
As yiou will notice that many times I will need to manually tell the Automapper
how to convert the Google.Protobuf.WellKnownTypes.Timestamp
date and time to C#
DateTime
So, I read before a bout something called IValueResolver
in Automapper, so I created my custom IValueResolver
to do this job instead of repteat it like the following :
Bu after using it like the following
I got a Compile-Time
error saying the message in the attached picture
Please any help to fix this issue ?
Massive thanks in advance <37 Replies
I have some resolvers working and the signature I use is
IValueResolver<CharaList, DbPlayerCharaData, ushort>
, so IValueResolver<TRootStartingType, TRootDestinationType, TProperty>
Should the
Resolver
return the original object
of class that used iduring mapping ?I want to say it returns the value but
$tias
But that will be strongly typed, and I want that
resolver
to be Generic
You can probably make it generic and pass the generics into the interface def
But I have never done that before