更新时间:2022-06-24 22:02:03
创建映射器提供程序
Create a mapper provider
public class MapperProvider
{
public MapperProvider() {
}
public MapperConfiguration GetMapperConfig()
{
var mce = new MapperConfigurationExpression();
mce.AddProfile<AutoMapperConfig>();
var mc = new MapperConfiguration(mce);
return mc;
}
}
注册映射配置
Register the mapping config
AutoMapper.IMapper fakeMapper = new Mapper(new
MapperProvider().GetMapperConfig());