What Is Custom Value Resolver

[Solved] What Is Custom Value Resolver | Shell - Code Explorer | yomemimo.com
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

Answers related to what is custom value resolver

Code Explorer Popular Question For Shell