【问题标题】:Issue while Automapper Upgrade to 5.1.1Automapper 升级到 5.1.1 时出现问题
【发布时间】:2016-09-28 21:36:39
【问题描述】:

我们在代码中使用了 automapper v5.0。在我们的 create map 语句中,我们有一个语句 ->

m.ResolveUsing((src, o, context) => (CodeObject)context.Options.Items["test"]))

当我们将 Automapper 版本升级到 5.1.1 时,上述语句中出现构建错误。

您能否建议如何使用最新版本更正此问题。

【问题讨论】:

    标签: automapper automapper-5


    【解决方案1】:

    在浏览了自动映射器源代码后,我终于得到了答案。我们可以这样做:

    m => m.ResolveUsing((src, o, destMemb, context) => (CodeObject)context.Items["test"]))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-01-24
      • 2011-06-18
      • 2019-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-04
      相关资源
      最近更新 更多