更新时间:2023-01-09 11:30:50
这里发生的事情是 Name
是通过 构造函数.避免这种情况的一个简单方法是告诉 AM 要使用什么构造函数:
What happens here is that Name
is mapped through the constructor. A simple way to avoid that is to tell AM what constructor to use:
CreateMap<Match, ViewCompany>().ConstructUsing(source=>new ViewCompany());