2
我使用的是AutoMapper 4.X到AutoMapper如下(簡單的代碼片段)調用config.ResolveUsing
時遷移5
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沒有resolutionResult
了,所以我不能夠得到我想要的信息(MemberName
)。
任何想法如何調整代碼以使其與AutoMapper 5一起使用?