I\'m trying to use Automapper to map to objects, the issue is one of the objects I\'m trying to map has a prefix \'Cust_\' in front of all its properties and one doesn\'t. I
Mapper.Initialize(cfg =>
{
cfg.RecognizeDestinationPrefixes("Cust_");
cfg.CreateMap();
});
A a = new A() {FirstName = "Cliff", LastName = "Mayson"};
B b = Mapper.Map(a);
//b.Cust_FirstName is "Cliff"
//b.Cust_LastName is "Mayson"
Or alternatively:
Mapper.Configuration.RecognizeDestinationPrefixes("Cust_");
Mapper.CreateMap();
...
B b = Mapper.Map(a);
...