Skip to content

Commit 897d363

Browse files
author
Oren (electricessence)
committed
Updated documentation.
1 parent 7d69827 commit 897d363

File tree

8 files changed

+575
-99
lines changed

8 files changed

+575
-99
lines changed

Extensions.cs

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,37 +1268,45 @@ public static IEnumerable<T> DequeueEach<T>(this Queue<T> source)
12681268
}
12691269

12701270
/// <summary>
1271-
/// Reads the first column from every record and returns the results as a list..
1272-
/// DBNull values are converted to null.
1271+
/// Reads the first column values from every record.
1272+
/// DBNull values are then converted to null.
12731273
/// </summary>
1274-
/// <returns>The list of values.</returns>
1274+
/// <returns>The enumerable first ordinal values.</returns>
12751275
public static IEnumerable<object> FirstOrdinalResults(this IDataReader reader)
12761276
{
12771277
var results = new Queue<object>(reader.Iterate(r => r.GetValue(0)));
12781278
return results.DequeueEach().DBNullToNull();
12791279
}
12801280

12811281
/// <summary>
1282-
/// Reads the first column from every record..
1283-
/// DBNull values are converted to null.
1282+
/// Reads the first column values from every record.
1283+
/// Any DBNull values are then converted to null and casted to type T0;
12841284
/// </summary>
12851285
/// <returns>The enumerable of casted values.</returns>
1286+
public static IEnumerable<T0> FirstOrdinalResults<T0>(this IDataReader reader)
1287+
=> reader.FirstOrdinalResults().Cast<T0>();
1288+
1289+
/// <summary>
1290+
/// Reads the first column values from every record.
1291+
/// DBNull values are then converted to null.
1292+
/// </summary>
1293+
/// <returns>The enumerable first ordinal values.</returns>
12861294
public static IEnumerable<object> FirstOrdinalResults(this IDbCommand command)
12871295
{
12881296
var results = new Queue<object>(IterateReaderInternal(command, CommandBehavior.Default, r => r.GetValue(0)));
12891297
return results.DequeueEach().DBNullToNull();
12901298
}
12911299

12921300
/// <summary>
1293-
/// Reads the first column from every record..
1294-
/// DBNull values are converted to null.
1301+
/// Reads the first column values from every record.
1302+
/// Any DBNull values are then converted to null and casted to type T0;
12951303
/// </summary>
12961304
/// <returns>The enumerable of casted values.</returns>
12971305
public static IEnumerable<T0> FirstOrdinalResults<T0>(this IDbCommand command)
12981306
=> command.FirstOrdinalResults().Cast<T0>();
12991307

13001308
/// <summary>
1301-
/// Reads the first column from every record and returns the results..
1309+
/// Reads the first column values from every record.
13021310
/// DBNull values are converted to null.
13031311
/// </summary>
13041312
/// <returns>The list of values.</returns>
@@ -1310,15 +1318,20 @@ public static async Task<IEnumerable<object>> FirstOrdinalResultsAsync(this DbDa
13101318
}
13111319

13121320
/// <summary>
1313-
/// Reads the first column from every record..
1314-
/// DBNull values are converted to null.
1321+
/// Reads the first column values from every record.
1322+
/// Any DBNull values are then converted to null and casted to type T0;
13151323
/// </summary>
13161324
/// <returns>The enumerable of casted values.</returns>
1317-
public static IEnumerable<T0> FirstOrdinalResults<T0>(this DbDataReader reader)
1318-
=> reader.FirstOrdinalResults().Cast<T0>();
1325+
public static async Task<IEnumerable<T0>> FirstOrdinalResultsAsync<T0>(this DbDataReader reader)
1326+
{
1327+
var results = new Queue<object>();
1328+
await reader.ForEachAsync(r => results.Enqueue(r.GetValue(0)));
1329+
return results.DequeueEach().DBNullToNull().Cast<T0>(); ;
1330+
}
1331+
13191332

13201333
/// <summary>
1321-
/// Reads the first column from every record and returns the results..
1334+
/// Reads the first column values from every record.
13221335
/// DBNull values are converted to null.
13231336
/// </summary>
13241337
/// <returns>The list of values.</returns>
@@ -1331,7 +1344,7 @@ public static async Task<IEnumerable<object>> FirstOrdinalResultsAsync(this DbCo
13311344

13321345
/// <summary>
13331346
/// Reads the first column from every record..
1334-
/// DBNull values are converted to null.
1347+
/// Any DBNull values are then converted to null and casted to type T0;
13351348
/// </summary>
13361349
/// <returns>The enumerable of casted values.</returns>
13371350
public static async Task<IEnumerable<T0>> FirstOrdinalResultsAsync<T0>(this DbCommand command)

Open.Database.Extensions.csproj

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<Description>Useful set of utilities and abstractions for simplifying modern database operations and ensuring DI compatibility.</Description>
1212
<RepositoryUrl>https://github.com/electricessence/Open.Database.Extensions</RepositoryUrl>
1313
<RepositoryType>git</RepositoryType>
14-
<Version>5.5.1</Version>
15-
<AssemblyVersion>5.5.1.0</AssemblyVersion>
16-
<FileVersion>5.5.1.0</FileVersion>
17-
<PackageReleaseNotes>Implemented Expression untyped setter istead of PropertyInfo.SetValue.</PackageReleaseNotes>
14+
<Version>5.5.2</Version>
15+
<AssemblyVersion>5.5.2.0</AssemblyVersion>
16+
<FileVersion>5.5.2.0</FileVersion>
17+
<PackageReleaseNotes>Improved documenation.</PackageReleaseNotes>
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -25,14 +25,22 @@
2525
<DocumentationFile>docs\Documentation.xml</DocumentationFile>
2626
</PropertyGroup>
2727

28+
<ItemGroup>
29+
<Compile Remove="api\**" />
30+
<Compile Remove="docs\**" />
31+
<EmbeddedResource Remove="api\**" />
32+
<EmbeddedResource Remove="docs\**" />
33+
<None Remove="api\**" />
34+
<None Remove="docs\**" />
35+
</ItemGroup>
36+
2837
<ItemGroup>
2938
<None Remove=".gitignore" />
3039
<None Remove="LICENSE" />
3140
<None Remove="README.md" />
3241
</ItemGroup>
3342

3443
<ItemGroup>
35-
<PackageReference Include="docfx.console" Version="2.32.0" />
3644
<PackageReference Include="System.Data.SqlClient" Version="4.4.2" />
3745
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.8.0" />
3846
</ItemGroup>

api/.manifest

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,12 @@
135135
"Open.Database.Extensions.Extensions.FirstOrDefault``1(System.Data.IDbCommand,System.Func{System.Data.IDataRecord,``0})": "Open.Database.Extensions.Extensions.yml",
136136
"Open.Database.Extensions.Extensions.FirstOrdinalResults(System.Data.IDataReader)": "Open.Database.Extensions.Extensions.yml",
137137
"Open.Database.Extensions.Extensions.FirstOrdinalResults(System.Data.IDbCommand)": "Open.Database.Extensions.Extensions.yml",
138-
"Open.Database.Extensions.Extensions.FirstOrdinalResults``1(System.Data.Common.DbDataReader)": "Open.Database.Extensions.Extensions.yml",
138+
"Open.Database.Extensions.Extensions.FirstOrdinalResults``1(System.Data.IDataReader)": "Open.Database.Extensions.Extensions.yml",
139139
"Open.Database.Extensions.Extensions.FirstOrdinalResults``1(System.Data.IDbCommand)": "Open.Database.Extensions.Extensions.yml",
140140
"Open.Database.Extensions.Extensions.FirstOrdinalResultsAsync(System.Data.Common.DbCommand)": "Open.Database.Extensions.Extensions.yml",
141141
"Open.Database.Extensions.Extensions.FirstOrdinalResultsAsync(System.Data.Common.DbDataReader)": "Open.Database.Extensions.Extensions.yml",
142142
"Open.Database.Extensions.Extensions.FirstOrdinalResultsAsync``1(System.Data.Common.DbCommand)": "Open.Database.Extensions.Extensions.yml",
143+
"Open.Database.Extensions.Extensions.FirstOrdinalResultsAsync``1(System.Data.Common.DbDataReader)": "Open.Database.Extensions.Extensions.yml",
143144
"Open.Database.Extensions.Extensions.ForEach(System.Data.IDataReader,System.Action{System.Data.IDataRecord})": "Open.Database.Extensions.Extensions.yml",
144145
"Open.Database.Extensions.Extensions.ForEachAsync(System.Data.Common.DbCommand,System.Action{System.Data.IDataRecord},System.Nullable{System.Threading.CancellationToken})": "Open.Database.Extensions.Extensions.yml",
145146
"Open.Database.Extensions.Extensions.ForEachAsync(System.Data.Common.DbDataReader,System.Action{System.Data.IDataRecord})": "Open.Database.Extensions.Extensions.yml",

docs/Documentation.xml

Lines changed: 21 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)