4 Replies
Why is foreach not possible? what is "this" referring to? The sales object? A property of sales? If you want to enumerate over
sales
, then you have to implement IEnumerable<>
DeserializeAsyncEnumerable returns an IAsyncEnumerable according to https://docs.microsoft.com/en-us/dotnet/api/system.text.json.jsonserializer.deserializeasyncenumerable?view=net-7.0
JsonSerializer.DeserializeAsyncEnumerable Method (System.Text.Json)
Wraps the UTF-8 encoded text into an IAsyncEnumerable that can be used to deserialize root-level JSON arrays in a streaming manner.
So to enumerate that, you need to use await foreach
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.