Skip to content
Isaac Abraham edited this page Jan 26, 2016 · 8 revisions

You may have types in your assemblies that you do not want to ever be considered for automatic registration into Unity through the Automapper. In order to instruct the Automapper to ignore these, apply one of the following: -

// Attributes
[DoNotMap] public interface IMyService { }
[DoNotMap] public class IMyOtherService { }

// Fluent
AutomapperConfig.Create()
                 .AndDoNotMapFor(typeof(IMyService), typeof(IMyOtherService));

This customisation operates over both interfaces and concrete types.