相关疑难解决方法(0)

自动映射从一个对象到嵌套对象的映射

使用Automapper 2.0映射内部对象的最佳方法是什么?

  1. 使用此问题中的解决方案(Automapper 1.0)

  2. 创建自定义值解析器

  3. public class DTOObject
    {
        // MainObject
        public int Id { get; set; }
        public string Name { get; set; }
    
        // SubObject (TopObject)
        public string TopText { get; set; }
        public string TopFont { get; set; }
    
        // SubObject (BottomObject)
        public string BottomText { get; set; }
        public string BottomFont { get; set; }
    }
    
    public class MainObject
    {
        public int Id { get; set; }
        public string Name { get; set; …
    Run Code Online (Sandbox Code Playgroud)

c# automapper automapper-2

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

automapper ×1

automapper-2 ×1

c# ×1