@@ -600,7 +600,7 @@ public GetAllFieldExpressionTreeInfo GetAllFieldExpressionTreeLevel2(bool isRere
600600 var name = dr . GetName ( a ) ;
601601 //expando[name] = row2.GetValue(a);
602602 if ( expandodic . ContainsKey ( name ) ) continue ;
603- expandodic . Add ( name , Utils . InternalDataReaderGetValue ( _commonUtils , dr , a ) ) ;
603+ expandodic . Add ( name , Utils . InternalDataReaderGetValue ( _commonUtils , dr , a , null ) ) ;
604604 }
605605 //expando = expandodic;
606606 return ( T1 ) ( ( object ) expandodic ) ;
@@ -682,8 +682,7 @@ public GetAllFieldExpressionTreeInfo GetAllFieldExpressionTreeLevel2(bool isRere
682682 var propGetSetMethod = prop . GetSetMethod ( true ) ;
683683 Expression readExpAssign = null ; //加速缓存
684684 if ( prop . PropertyType . IsArray ) readExpAssign = Expression . New ( Utils . RowInfo . Constructor ,
685- Utils . GetDataReaderValueBlockExpression ( prop . PropertyType , Expression . Call ( Utils . MethodDataReaderGetValue , new Expression [ ] { Expression . Constant ( _commonUtils ) , rowExp , dataIndexExp } ) ) ,
686- //Expression.Call(Utils.MethodGetDataReaderValue, new Expression[] { Expression.Constant(prop.PropertyType), Expression.Call(rowExp, Utils.MethodDataReaderGetValue, dataIndexExp) }),
685+ Utils . GetDataReaderValueBlockExpression ( prop . PropertyType , Expression . Call ( Utils . MethodDataReaderGetValue , new Expression [ ] { Expression . Constant ( _commonUtils ) , rowExp , dataIndexExp , Expression . Constant ( prop ) } ) ) ,
687686 Expression . Add ( dataIndexExp , Expression . Constant ( 1 ) )
688687 ) ;
689688 else
@@ -692,8 +691,7 @@ public GetAllFieldExpressionTreeInfo GetAllFieldExpressionTreeLevel2(bool isRere
692691 if ( proptypeGeneric . IsNullableType ( ) ) proptypeGeneric = proptypeGeneric . GetGenericArguments ( ) . First ( ) ;
693692 if ( proptypeGeneric . IsEnum ||
694693 Utils . dicExecuteArrayRowReadClassOrTuple . ContainsKey ( proptypeGeneric ) ) readExpAssign = Expression . New ( Utils . RowInfo . Constructor ,
695- Utils . GetDataReaderValueBlockExpression ( prop . PropertyType , Expression . Call ( Utils . MethodDataReaderGetValue , new Expression [ ] { Expression . Constant ( _commonUtils ) , rowExp , dataIndexExp } ) ) ,
696- //Expression.Call(Utils.MethodGetDataReaderValue, new Expression[] { Expression.Constant(prop.PropertyType), Expression.Call(rowExp, Utils.MethodDataReaderGetValue, dataIndexExp) }),
694+ Utils . GetDataReaderValueBlockExpression ( prop . PropertyType , Expression . Call ( Utils . MethodDataReaderGetValue , new Expression [ ] { Expression . Constant ( _commonUtils ) , rowExp , dataIndexExp , Expression . Constant ( prop ) } ) ) ,
697695 Expression . Add ( dataIndexExp , Expression . Constant ( 1 ) )
698696 ) ;
699697 else
@@ -739,7 +737,8 @@ public GetAllFieldExpressionTreeInfo GetAllFieldExpressionTreeLevel2(bool isRere
739737 foreach ( var col in tb . Table . Columns . Values )
740738 {
741739 var drvalType = col . Attribute . MapType . NullableTypeOrThis ( ) ;
742- var propGetSetMethod = tb . Table . Properties [ col . CsName ] . GetSetMethod ( true ) ;
740+ var colprop = tb . Table . Properties [ col . CsName ] ;
741+ var propGetSetMethod = colprop . GetSetMethod ( true ) ;
743742 if ( col . CsType == col . Attribute . MapType &&
744743 _orm . Aop . AuditDataReaderHandler == null &&
745744 _dicMethodDataReaderGetValue . TryGetValue ( col . Attribute . MapType . NullableTypeOrThis ( ) , out var drGetValueMethod ) )
@@ -755,7 +754,7 @@ public GetAllFieldExpressionTreeInfo GetAllFieldExpressionTreeLevel2(bool isRere
755754 {
756755 var drvalExpCatch = Utils . GetDataReaderValueBlockExpression (
757756 col . CsType ,
758- Expression . Call ( Utils . MethodDataReaderGetValue , new Expression [ ] { Expression . Constant ( _commonUtils ) , rowExp , Expression . Constant ( colidx ) } )
757+ Expression . Call ( Utils . MethodDataReaderGetValue , new Expression [ ] { Expression . Constant ( _commonUtils ) , rowExp , Expression . Constant ( colidx ) , Expression . Constant ( colprop ) } )
759758 ) ;
760759 blockExp . Add ( Expression . TryCatch (
761760 Expression . Call ( retExp , propGetSetMethod , drvalExp ) ,
@@ -780,7 +779,7 @@ public GetAllFieldExpressionTreeInfo GetAllFieldExpressionTreeLevel2(bool isRere
780779 {
781780 var drvalExp = Utils . GetDataReaderValueBlockExpression (
782781 col . CsType ,
783- Expression . Call ( Utils . MethodDataReaderGetValue , new Expression [ ] { Expression . Constant ( _commonUtils ) , rowExp , Expression . Constant ( colidx ) } )
782+ Expression . Call ( Utils . MethodDataReaderGetValue , new Expression [ ] { Expression . Constant ( _commonUtils ) , rowExp , Expression . Constant ( colidx ) , Expression . Constant ( colprop ) } )
784783 ) ;
785784 blockExp . Add ( Expression . Call ( retExp , propGetSetMethod , Expression . Convert ( drvalExp , col . CsType ) ) ) ;
786785 }
0 commit comments