【发布时间】:2022-09-23 05:24:49
【问题描述】:
我们目前在代码中使用 AutoMapper v8,并计划升级到 9.0+。为此,我们需要将所有静态映射器转换为基于实例的映射器。
我们的代码库中有很多代码,如下所示。
public class ConfigModel
{
public int MyProperty1 { get; set; }
...
public ConfigModel Load(ConfigEntity config)
{
Mapper.Map(config, this);
return this;
}
}
我正在寻找可以用IMapper 做的类似事情。我们只需要将实体映射到模型中的属性。
-
欢迎来到堆栈溢出。请通过tour 了解 Stack Overflow 的工作原理,并阅读How to Ask 了解如何提高问题的质量。目前尚不清楚您在问什么或问题是什么。请edit你的问题包括你想问的问题。如果可能,请添加minimal reproducible example。
标签: c# automapper