Skip to content

Understanding your mapping

Steve Wilkes edited this page Jul 1, 2017 · 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 the ReadableExpressions VS extension. If you need to see the code outside VS, you can use the ReadableExpressions package directly.

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.

Clone this wiki locally