Merge two objects to produce third using AutoMapper

前端 未结 5 1547
日久生厌
日久生厌 2020-12-14 01:25

I know it\'s AutoMapper and not AutoMerge(r), but...

I\'ve started using AutoMapper and have a need to Map A -> B, and to add some properties from C so that B become

5条回答
  •  执念已碎
    2020-12-14 01:52

    You can do this with the ValueInjecter

     a.InjectFrom(b)
      .InjectFrom(c)
      .InjectFrom(dOrBOrWhateverObject);
    

提交回复
热议问题