@@ -49,7 +49,7 @@ public LambdaExpression CreateMapperLambda(HashSet<TypeMap> typeMapsPath)
4949 {
5050 variables . AddRange ( _typeMap . IncludedMembersTypeMaps . Select ( i => i . Variable ) ) ;
5151 statements . AddRange ( variables . Zip ( _typeMap . IncludedMembersTypeMaps , ( v , i ) =>
52- Assign ( v , i . MemberExpression . ReplaceParameters ( Source ) . NullCheck ( ) ) ) ) ;
52+ Assign ( v , i . MemberExpression . ReplaceParameters ( parameters ) . NullCheck ( ) ) ) ) ;
5353 }
5454 var createDestinationFunc = CreateDestinationFunc ( ) ;
5555 var assignmentFunc = CreateAssignmentFunc ( createDestinationFunc ) ;
@@ -161,7 +161,8 @@ private Expression CreateAssignmentFunc(Expression createDestination)
161161 {
162162 var actions = new List < Expression > { createDestination } ;
163163 Expression typeMapExpression = null ;
164- if ( _typeMap . MaxDepth > 0 )
164+ var hasMaxDepth = _typeMap . MaxDepth > 0 ;
165+ if ( hasMaxDepth )
165166 {
166167 typeMapExpression = Constant ( _typeMap ) ;
167168 actions . Add ( Call ( ContextParameter , IncTypeDepthInfo , typeMapExpression ) ) ;
@@ -193,7 +194,7 @@ private Expression CreateAssignmentFunc(Expression createDestination)
193194 {
194195 actions . Add ( afterMapAction . ReplaceParameters ( Source , _destination , ContextParameter ) ) ;
195196 }
196- if ( _typeMap . MaxDepth > 0 )
197+ if ( hasMaxDepth )
197198 {
198199 actions . Add ( Call ( ContextParameter , DecTypeDepthInfo , typeMapExpression ) ) ;
199200 }
@@ -382,7 +383,7 @@ private Expression BuildValueResolverFunc(MemberMap memberMap, Expression custom
382383 {
383384 valueResolverFunc = memberMap . NullSubstitute ( valueResolverFunc ) ;
384385 }
385- else if ( ! memberMap . AllowsNullDestinationValues ( ) )
386+ else if ( ! memberMap . AllowsNullDestinationValues )
386387 {
387388 var toCreate = memberMap . SourceType ;
388389 if ( ! toCreate . IsAbstract && toCreate . IsClass && ! toCreate . IsArray )
0 commit comments