I was using a AutoMapper 4.X as following (simplified snippet)
Mapper.CreateMap<A,B>()
.ForMember(myB.MyProp, o => o.Foo()); // Foo is an extention method -> see below
public static void Foo<T> (this IMemberConfigurationExpression<T> config)
{
config.ResolveUsing((resolutionResult, source) =>
{
var name = resolutionResult.Context.MemberName; // this is what I want
}
}
AutoMapper 5.X does not have a resolutionResult
anymore when calling config.ResolveUsing
so I'm not able to get the information that I want (MemberName
) out of it.
Any Idea how to adapt the code to make it work with AutoMapper 5 ?