With AutoMapper, I am using a ValueResolver that returns a structure like this
struct MyStruct
{
public int propA;
public int propB;
By using FromMember
you can pass a property from the source to your ValueResolver.
You can use something like this:
.ForMember(dest => dest.SomePropA, opt=> opt.ResolveUsing<MyResolver>().FromMember(src => src.propA))
If you don't specify FromMember
, AutoMapper will pass the source to your ValueResolver.