1
我認爲標題已經很好地解釋了問題。我有一個源類型:使用Automapper自定義映射,其中目標中的字段是源中兩個字段的串聯
public class Employee
{
public string Name { get; set; }
public string DateOfBirth { get; set; }
public string srcImage { get; set; }
public string Email { get; set; }
public string Role { get; set; }
}
和
public class EmployeeViewModel
{
public string Name { get; set; }
public string Surname { get; set; }
public string DateOfBirth { get; set; }
public string Email { get; set; }
public string Role { get; set; }
}
我想用automapper從EmployeeViewModel轉化爲員工和名員工的是名和姓串聯在EmployeeViewModel中。
請問您能否介紹一下如何設置MapperConfiguration?謝謝!