File tree Expand file tree Collapse file tree
Source/RealTimeKqlLibrary/Output Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,13 +118,16 @@ public void OutputAction(IDictionary<string, object> obj)
118118 }
119119
120120 // Convert all System.Dynamic.ExpandoObject items into Dictionary<string, object> types
121- foreach ( var pair in obj )
121+ var keys = obj . Keys . ToArray ( ) ;
122+ for ( int i = 0 ; i < keys . Length ; i ++ )
122123 {
123- if ( pair . Value != null && typeof ( System . Dynamic . ExpandoObject ) == pair . Value . GetType ( ) )
124+ var key = keys [ i ] ;
125+ var value = obj [ key ] ;
126+ if ( value != null && typeof ( System . Dynamic . ExpandoObject ) == value . GetType ( ) )
124127 {
125- var dict = ( ( IDictionary < string , object > ) ( pair . Value ) ) . ToDictionary (
128+ var dict = ( ( IDictionary < string , object > ) ( value ) ) . ToDictionary (
126129 kvp => kvp . Key , kvp => kvp . Value ) ;
127- obj [ pair . Key ] = dict ;
130+ obj [ key ] = dict ;
128131 }
129132 }
130133
You can’t perform that action at this time.
0 commit comments