Question : what is custom value resolver
Answered by : hurt-hedgehog-0zljig7wbx0x
public class Source
{ public int Value1 { get; set; } public int Value2 { get; set; }
}
public class Destination
{ public int Total { get; set; }
}
Source : https://docs.automapper.org/en/stable/Custom-value-resolvers.html | Last Update : Fri, 22 Oct 21
Question : what is custom value resolver
Answered by : hurt-hedgehog-0zljig7wbx0x
public interface IValueResolver<in TSource, in TDestination, TDestMember>
{ TDestMember Resolve(TSource source, TDestination destination, TDestMember destMember, ResolutionContext context);
}
Source : https://docs.automapper.org/en/stable/Custom-value-resolvers.html | Last Update : Fri, 22 Oct 21
Question : what is custom value resolver
Answered by : hurt-hedgehog-0zljig7wbx0x
public class CustomResolver : IValueResolver<Source, Destination, int>
{ public int Resolve(Source source, Destination destination, int member, ResolutionContext context) { return source.Value1 + source.Value2; }
}
Source : https://docs.automapper.org/en/stable/Custom-value-resolvers.html | Last Update : Fri, 22 Oct 21