Skip to content

Commit e29b34a

Browse files
author
Oren Ferrari
committed
Updates
1 parent dbbe070 commit e29b34a

2 files changed

Lines changed: 10 additions & 19 deletions

File tree

Extensions.Retrieve.cs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public static QueryResult<Queue<object[]>> Retrieve(this IDbCommand command, str
143143
/// <param name="reader">The reader to enumerate.</param>
144144
/// <param name="token">Optional cancellation token.</param>
145145
/// <param name="useReadAsync">If true (default) will iterate the results using .ReadAsync() otherwise will only Execute the reader asynchronously and then use .Read() to iterate the results but still allowing cancellation.</param>
146-
/// <returns>The QueryResult that contains a buffer block of the results and the column mappings.</returns>
146+
/// <returns>The QueryResult that contains all the results and the column mappings.</returns>
147147
public static async Task<QueryResult<Queue<object[]>>> RetrieveAsync(this DbDataReader reader, CancellationToken? token = null, bool useReadAsync = true)
148148
{
149149
var t = token ?? CancellationToken.None;
@@ -185,21 +185,11 @@ static async Task<QueryResult<Queue<object[]>>> RetrieveAsyncInternal(DbDataRead
185185
var t = token ?? CancellationToken.None;
186186
var buffer = new Queue<object[]>();
187187

188-
if (!readStarted)
189-
readStarted = useReadAsync
190-
? await reader.ReadAsync(t)
191-
: (!t.IsCancellationRequested && reader.Read());
192-
193188
if (readStarted)
194-
{
195-
do
196-
{
197-
buffer.Enqueue(handler(reader));
198-
}
199-
while (useReadAsync
200-
? await reader.ReadAsync(t)
201-
: (!t.IsCancellationRequested && reader.Read()));
202-
}
189+
buffer.Enqueue(handler(reader));
190+
191+
while (useReadAsync ? await reader.ReadAsync(t) : (!t.IsCancellationRequested && reader.Read()))
192+
buffer.Enqueue(handler(reader));
203193

204194
if (!useReadAsync)
205195
t.ThrowIfCancellationRequested();

Open.Database.Extensions.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<Description>Useful set of utilities and abstractions for simplifying modern data-access operations and ensuring DI compatibility.</Description>
1212
<RepositoryUrl>https://github.com/electricessence/Open.Database.Extensions</RepositoryUrl>
1313
<RepositoryType>git</RepositoryType>
14-
<Version>5.12.1</Version>
15-
<AssemblyVersion>5.12.0.0</AssemblyVersion>
16-
<FileVersion>5.12.0.0</FileVersion>
17-
<PackageReleaseNotes>Improved flag handling.</PackageReleaseNotes>
14+
<Version>5.12.2</Version>
15+
<AssemblyVersion>5.12.2.0</AssemblyVersion>
16+
<FileVersion>5.12.2.0</FileVersion>
17+
<PackageReleaseNotes></PackageReleaseNotes>
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -23,6 +23,7 @@
2323

2424
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
2525
<DocumentationFile>docs\Documentation.xml</DocumentationFile>
26+
<LangVersion>latest</LangVersion>
2627
</PropertyGroup>
2728

2829
<ItemGroup>

0 commit comments

Comments
 (0)