我想映射类(实体),
public class Source {
public int x;
public string y;
public bool z;
public int a;
public int b;
public int c;
//bunch of other fields
//...
//..
//.
}
到以下类(视图模型):
public class Destination {
public MyClass1 A;
public MyClass2 B;
}
其中 MyClass1、MyClass2 定义如下:
public class MyClass1 {
public int x;
public string y;
public bool z;
}
public class MyClass2 {
public int a;
public int b;
public int c;
}
Automapper可以做到这一点吗?