Skip to content
chaowlert edited this page Jan 29, 2019 · 13 revisions

Step-into debugging

PM> Install-Package ExpressionDebugger

This plugin allow you to perform step-into debugging!

Usage

Then add following code on start up (or anywhere before mapping is compiled)

TypeAdapterConfig.GlobalSettings.Compiler = exp => exp.CompileWithDebugInfo();

Now on your mapping code.

var dto = poco.Adapt<SimplePoco, SimpleDto>(); <--- you will step-into this function!!

image

Using internal classes or members

private, protected and internal don't allow in debug mode.

Get mapping script

We can also see how Mapster generate mapping logic with ToScript method.

var script = poco.BuildAdapter()
                .CreateMapExpression<SimpleDto>()
                .ToScript();

Visual Studio for Mac

To step-into debugging, you might need to emit file

var opt = new ExpressionCompilationOptions { EmitFile = true };
var func = lambda.CompileWithDebugInfo(opt);
func(); //<-- you can step-into this function!!
Clone this wiki locally