We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e02956a commit 4139e26Copy full SHA for 4139e26
1 file changed
Orm/Xtensive.Orm/Orm/Providers/CommandProcessing/DataReader.cs
@@ -95,7 +95,16 @@ public async ValueTask DisposeAsync()
95
await command.DisposeAsync().ConfigureAwait(false);
96
}
97
else {
98
- await ((IAsyncEnumerator<Tuple>) source).DisposeAsync().ConfigureAwait(false);
+ if (source is IAsyncEnumerator<Tuple> asyncSource) {
99
+ // true async enumerable source
100
+ await asyncSource.DisposeAsync().ConfigureAwait(false);
101
+ }
102
+ else {
103
+ // preloaded collection of elements,
104
+ // like in case of delayed query which has already been read from database
105
+ // or greedy enumeration
106
+ ((IEnumerator<Tuple>) source).Dispose();
107
108
109
110
0 commit comments