Is there any advantage to using Mapper vs Implicit Operators?

Mapper Automap:

Mapper.CreateMap<ObjectType1, ObjectType2>() .ForMember(o1 => o1.PropName, mapper => mapper.MapFrom(o2 => o2.Prop2Name)); Mapper.Map(object1, object2); 

Implicit statement:

 public static implicit operator Object1(Object2 o2) { Object1 o1 = new Object2(); //Mapping code here... return o1; } 
+7
source share
1 answer

There is no reason you could not use both together by calling Mapper.Map from an implicit statement.

Using AutoMapper allows you to rely on automatically generated matching code, so you do not need to use ForMember to match each member individually.

+7
source

All Articles