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一起使用?