Mapper.Initialize(cfg =>
{
cfg.ShouldMapProperty = p => true;
cfg.ShouldMapField = f => !f.IsDefined(typeof(System.Runtime.CompilerServices.CompilerGeneratedAttribute));
});
The removes existing maps. The trouble I have is when this is run, I may have already created some maps and those are lost by this call.
Is there anyway to call Initialize but have it preserve existing maps? Or alternatively is there any way to set these CFG properties without initializing?
I'm trying to relieve clients from my business classes from having to explicitly call an intialise, and want to set up the maps in static constructors.
Thanks
--
You received this message because you are subscribed to the Google Groups "AutoMapper-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automapper-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.