/images/logo.png

懶散的工程師 Lou

ValueInjecter@3.2.0 簡單用法

基本用法 一般對應 var mapper = Mapper.Map<TargetType>(customer); var mapper = Mapper.Map<FromType, TargetType>(customer); 客製化對應 1 2 3 4 5 6 7 Mapper.AddMap<FromType, TargetType>(src => { var res = new TargetType(); res.InjectFrom(src); // 對應相同名字及型別的屬性 res.FullName = src.FirstName + " " + src.LastName; return res; }); InjectFrom 的用法 Inj