File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,20 +72,13 @@ public static Foo SetupFooInstance()
7272
7373 private static void SetupCompiler ( MapsterCompilerType type )
7474 {
75- switch ( type )
75+ TypeAdapterConfig . GlobalSettings . Compiler = type switch
7676 {
77- case MapsterCompilerType . Default :
78- TypeAdapterConfig . GlobalSettings . Compiler = _defaultCompiler ;
79- break ;
80- case MapsterCompilerType . Roslyn :
81- TypeAdapterConfig . GlobalSettings . Compiler = exp => exp . CompileWithDebugInfo ( ) ;
82- break ;
83- case MapsterCompilerType . FEC :
84- TypeAdapterConfig . GlobalSettings . Compiler = exp => exp . CompileFast ( ) ;
85- break ;
86- default :
87- throw new ArgumentOutOfRangeException ( nameof ( type ) ) ;
88- }
77+ MapsterCompilerType . Default => _defaultCompiler ,
78+ MapsterCompilerType . Roslyn => exp => exp . CompileWithDebugInfo ( ) ,
79+ MapsterCompilerType . FEC => exp => exp . CompileFast ( ) ,
80+ _ => throw new ArgumentOutOfRangeException ( nameof ( type ) ) ,
81+ } ;
8982 }
9083 public static void ConfigureMapster ( Foo fooInstance , MapsterCompilerType type )
9184 {
You can’t perform that action at this time.
0 commit comments