-
Notifications
You must be signed in to change notification settings - Fork 380
Debugging
chaowlert edited this page Jan 29, 2019
·
13 revisions
PM> Install-Package ExpressionDebugger
This plugin allow you to perform step-into debugging!
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!!
private
, protected
and internal
don't allow in debug mode.
We can also see how Mapster generate mapping logic with ToScript
method.
var script = poco.BuildAdapter()
.CreateMapExpression<SimpleDto>()
.ToScript();
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!!
- Configuration
- Config inheritance
- Config instance
- Config location
- Config validation & compilation
- Config for nested mapping
- Custom member matching logic
- Constructor mapping
- Before & after mapping
- Setting values
- Shallow & merge mapping
- Recursive & object references
- Custom conversion logic
- Inheritance