Best way to map objects differently in different situations (AutoMapper) -


i'm using automapper , want know way best approach map objects differently in different situations (for example, ignore 1 field in methoda, include field in methdob etc.). can create own mappingengine wonderign if there better way achieve that.

you can map 1 source multiple destinations automapper. example can have source object with

person

  • id
  • firstname
  • lastname
  • phonenumber

and view models

contactinfoviewmodel

  • firstname
  • phonenumber

bioviewmodel

  • firstname
  • lastname
  • phonenumber
mapper.map<person, contactviewmodel>(); mapper.map<person, bioviewmodel>(); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -