Skip to content

Commit da1ee9b

Browse files
fixed invalid operation in adx output (#37)
1 parent 242f48f commit da1ee9b

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Source/RealTimeKqlLibrary/Output/AdxOutput.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)