李芬妹妹抓紧联系我在引用nuget包中添加AutoMapper包,在Using中进行引用!
先准备2个类 :Cloumn和NClounm 然后在App_Start中创建一个类继承Profile然后创建无参构造函数

CreateMap<Cloumn,NCloumn>();
然后在需要映射到地方

第四步:在运行程序全局应用文件Global.asax.cs中添加配置
Mapper.Initialize(a => a.AddProfile(typeof (BLLMapper))); BllMapper为第二步添加的类文件名

https://blog.csdn.net/qq_30648687/article/details/79784602
微信:wlx8583
网友评论