Hi I have some major problems with auto mapper and it being slow. I am not sure how to speed it up.
I am using nhibernate,fluent nhibernate and asp.net mvc 3.0
A good tip is to optimize the configuration of AutoMapper, use Ignore for the properties of the ViewModels, and make the method call to validate the mappings "Mapper.AssertConfigurationIsValid()".
Mapper.Initialize(cfg =>
{
cfg.ValidateInlineMaps = true;
cfg.AllowNullCollections = false;
cfg.AllowNullDestinationValues = true;
cfg.DisableConstructorMapping(); // <= In the case of my project, I do not use builders, I had a performance gain.
cfg.AddProfile();
cfg.AddProfile();
});
Mapper.AssertConfigurationIsValid();