Skip to content

Understanding your mapping

Lucian Bargaoanu edited this page Dec 20, 2016 · 4 revisions

AutoMapper creates an execution plan for your mapping. That execution plan can be viewed as an expression tree during debugging. You can get a better view of the resulting code by installing a VS extension. If you need to see the code outside VS, you can use directly the package.

var configuration = new MapperConfiguration(cfg => cfg.CreateMap<Foo, Bar>());
var executionPlan = configuration.BuildExecutionPlan(typeof(Foo), typeof(Bar));

Be sure to remove all such code before release.