@@ -68,7 +68,7 @@ TResult IAsyncQueryProvider.ExecuteAsync<TResult>(Expression expression, Cancell
6868
6969 public System . Collections . Generic . IAsyncEnumerable < TResult > ExecuteAsync < TResult > ( Expression expression )
7070 {
71- return new AsyncEnumerableAdaper < TResult > ( QueryProvider . ExecuteAsync < TResult > ( expression ) ) ;
71+ return new AsyncEnumerableAdapter < TResult > ( QueryProvider . ExecuteAsync < TResult > ( expression ) ) ;
7272 }
7373
7474 IAsyncEnumerable < TResult > IQueryProviderAsync . ExecuteAsync < TResult > ( Expression expression )
@@ -99,38 +99,40 @@ IEnumerator IEnumerable.GetEnumerator()
9999
100100 #endregion
101101
102- System . Collections . Generic . IAsyncEnumerator < T > System . Collections . Generic . IAsyncEnumerable < T > . GetAsyncEnumerator ( CancellationToken cancellationTokent )
102+ System . Collections . Generic . IAsyncEnumerator < T > System . Collections . Generic . IAsyncEnumerable < T > . GetAsyncEnumerator ( CancellationToken cancellationToken )
103103 {
104- return ExecuteAsync < T > ( Expression ) . GetAsyncEnumerator ( CancellationToken . None ) ;
104+ return ExecuteAsync < T > ( Expression ) . GetAsyncEnumerator ( cancellationToken ) ;
105105 }
106106
107- class AsyncEnumerableAdaper < TEntity > : System . Collections . Generic . IAsyncEnumerable < TEntity >
107+ class AsyncEnumerableAdapter < TEntity > : System . Collections . Generic . IAsyncEnumerable < TEntity >
108108 {
109109 private IAsyncEnumerable < TEntity > AsyncEnumerable { get ; }
110110
111- public AsyncEnumerableAdaper ( IAsyncEnumerable < TEntity > asyncEnumerable )
111+ public AsyncEnumerableAdapter ( IAsyncEnumerable < TEntity > asyncEnumerable )
112112 {
113113 AsyncEnumerable = asyncEnumerable ;
114114 }
115115
116- public System . Collections . Generic . IAsyncEnumerator < TEntity > GetAsyncEnumerator ( CancellationToken cancellationToken = new CancellationToken ( ) )
116+ public System . Collections . Generic . IAsyncEnumerator < TEntity > GetAsyncEnumerator ( CancellationToken cancellationToken = default )
117117 {
118- return new AsyncEnumeratorAdapter < TEntity > ( AsyncEnumerable . GetEnumerator ( ) ) ;
118+ return new AsyncEnumeratorAdapter < TEntity > ( AsyncEnumerable . GetEnumerator ( ) , cancellationToken ) ;
119119 }
120120 }
121121
122122 class AsyncEnumeratorAdapter < TEntity > : System . Collections . Generic . IAsyncEnumerator < TEntity >
123123 {
124+ private readonly CancellationToken _cancellationToken ;
124125 private IAsyncEnumerator < TEntity > AsyncEnumerator { get ; }
125126
126- public AsyncEnumeratorAdapter ( IAsyncEnumerator < TEntity > asyncEnumerator )
127+ public AsyncEnumeratorAdapter ( IAsyncEnumerator < TEntity > asyncEnumerator , CancellationToken cancellationToken )
127128 {
128- AsyncEnumerator = asyncEnumerator ;
129+ _cancellationToken = cancellationToken ;
130+ AsyncEnumerator = asyncEnumerator ;
129131 }
130132
131133 public ValueTask < bool > MoveNextAsync ( )
132134 {
133- return new ValueTask < bool > ( AsyncEnumerator . MoveNext ( CancellationToken . None ) ) ;
135+ return new ValueTask < bool > ( AsyncEnumerator . MoveNext ( _cancellationToken ) ) ;
134136 }
135137
136138 public TEntity Current => AsyncEnumerator . Current ;
0 commit comments