File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
SubSonic.Core.Abstractions
SubSonic.Tests/DAL/ExtensionMethod Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 66 <Authors >Kenneth Carter</Authors >
77 <Version >4.1.0-alpha.1</Version >
88 <SignAssembly >true</SignAssembly >
9+ <IncludeSymbols >true</IncludeSymbols >
10+ <SymbolPackageFormat >snupkg</SymbolPackageFormat >
911 <AssemblyOriginatorKeyFile >SubSonicStrongName.snk</AssemblyOriginatorKeyFile >
1012 <PackageLicenseFile >LICENSE.MD</PackageLicenseFile >
1113 </PropertyGroup >
Original file line number Diff line number Diff line change @@ -87,17 +87,21 @@ public async Task ShouldBeAbleToEnumeratePagedDataAsync()
8787 recordCount = People . Count ( ) ,
8888 pageSize = 10 ,
8989 pageCount = ( int ) Math . Ceiling ( ( decimal ) recordCount / pageSize ) ,
90- count = 0 ;
90+ cnt = 0 ,
91+ pageCnt = 0 ;
9192
9293 foreach ( var page in Context . People . ToPagedCollection ( pageSize ) . GetPages ( ) )
9394 {
94- await foreach ( Person person in page )
95+ pageCnt ++ ;
96+
97+ await foreach ( Person person in page )
9598 {
96- count ++ ;
99+ cnt ++ ;
97100 }
98101 }
99102
100- count . Should ( ) . Be ( recordCount ) ;
103+ pageCnt . Should ( ) . Be ( pageCount ) ;
104+ cnt . Should ( ) . Be ( recordCount ) ;
101105 }
102106 }
103107}
Original file line number Diff line number Diff line change 55using System . Data ;
66using System . Data . Common ;
77using System . Globalization ;
8+ using System . Runtime . CompilerServices ;
89using System . Text ;
910using System . Threading ;
1011using System . Threading . Tasks ;
@@ -107,7 +108,7 @@ IEnumerator IEnumerable.GetEnumerator()
107108 }
108109
109110#if NETSTANDARD2_0
110- public IAsyncEnumerator < TEntity > GetAsyncEnumerator ( CancellationToken cancellationToken = default )
111+ IAsyncEnumerator < TEntity > IAsyncEnumerable < TEntity > . GetAsyncEnumerator ( CancellationToken cancellationToken )
111112 {
112113 return new Dasync . Collections . AsyncEnumerable < TEntity > ( async yield =>
113114 {
@@ -116,14 +117,15 @@ public IAsyncEnumerator<TEntity> GetAsyncEnumerator(CancellationToken cancellati
116117 await yield . ReturnAsync ( entity ) . ConfigureAwait ( false ) ;
117118 }
118119 } ) . GetAsyncEnumerator ( cancellationToken ) ;
120+ }
119121#elif NETSTANDARD2_1
120- public async IAsyncEnumerator < TEntity > GetAsyncEnumerator ( CancellationToken cancellationToken = default )
122+ async IAsyncEnumerator < TEntity > IAsyncEnumerable < TEntity > . GetAsyncEnumerator ( CancellationToken cancellationToken )
121123 {
122- await foreach ( TEntity entity in this . WithCancellation ( cancellationToken ) )
124+ foreach ( TEntity entity in this )
123125 {
124126 yield return entity ;
125127 }
126- #endif
127128 }
129+ #endif
128130 }
129131}
You can’t perform that action at this time.
0 commit comments