@@ -82,6 +82,7 @@ private static List<TypeAdapterRule> CreateRuleTemplate()
8282
8383 public bool RequireDestinationMemberSource { get ; set ; }
8484 public bool RequireExplicitMapping { get ; set ; }
85+ public bool RequireExplicitMappingPrimitive { get ; set ; }
8586 public bool AllowImplicitDestinationInheritance { get ; set ; }
8687 public bool AllowImplicitSourceInheritance { get ; set ; } = true ;
8788 public bool SelfContainedCodeGeneration { get ; set ; }
@@ -495,7 +496,7 @@ private LambdaExpression CreateMapInvokeExpression(Type sourceType, Type destina
495496
496497 internal Expression CreateMapInvokeExpressionBody ( Type sourceType , Type destinationType , Expression p )
497498 {
498- if ( RequireExplicitMapping )
499+ if ( RequireExplicitMapping || RequireExplicitMappingPrimitive )
499500 {
500501 var key = new TypeTuple ( sourceType , destinationType ) ;
501502 _mapDict [ key ] = Compiler ( CreateMapExpression ( key , MapType . Map ) ) ;
@@ -518,7 +519,7 @@ internal Expression CreateMapInvokeExpressionBody(Type sourceType, Type destinat
518519
519520 internal Expression CreateMapToTargetInvokeExpressionBody ( Type sourceType , Type destinationType , Expression p1 , Expression p2 )
520521 {
521- if ( RequireExplicitMapping )
522+ if ( RequireExplicitMapping || RequireExplicitMappingPrimitive )
522523 {
523524 var key = new TypeTuple ( sourceType , destinationType ) ;
524525 _mapToTargetDict [ key ] = Compiler ( CreateMapExpression ( key , MapType . MapToTarget ) ) ;
0 commit comments