Skip to content

Commit 81596c1

Browse files
Revert the To<T> array swap; keep params IEnumerable + priority
The Phase 4 change of To<T>'s params overload from IEnumerable to a (Field,Column)[] array gave no functional benefit: params IEnumerable<(...)> accepts the identical call shapes (multi-arg new(...), collection expressions, tuples), verified empirically. The array was only ever REQUIRED for the Results family, whose same-arity IEnumerable sibling caused a CS0111 collision -- To<T>'s sibling has an extra `bool clearSourceTable`, so no collision, so IEnumerable is fine and is the more flexible (a List binds the params overload directly). The real enabler was the [OverloadResolutionPriority(1)] added alongside, which disambiguates the collection-expression forms; that stays. Only the array-> IEnumerable swap is reverted. PublicAPI baseline updated. Build 0/0; 102 tests (To<T> assumption tests now bind through params IEnumerable). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3b39a85 commit 81596c1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Source/Core/Extensions/_.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static IEnumerable<DataRow> AsEnumerableCore(DataRowCollection rows)
188188

189189
/// <inheritdoc cref="To{T}(DataTable, IEnumerable{KeyValuePair{string, string?}}?, bool)"/>
190190
[System.Runtime.CompilerServices.OverloadResolutionPriority(1)]
191-
public static IEnumerable<T> To<T>(this DataTable table, params (string Field, string? Column)[] fieldMappingOverrides) where T : new()
191+
public static IEnumerable<T> To<T>(this DataTable table, params IEnumerable<(string Field, string? Column)> fieldMappingOverrides) where T : new()
192192
=> Transformer<T>
193193
.Create(fieldMappingOverrides)
194194
.Results(table, false);

Source/Core/PublicAPI.Shipped.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static Open.Database.Extensions.CoreExtensions.RetrieveAsync(this System.Data.Co
407407
static Open.Database.Extensions.CoreExtensions.RetrieveAsync(this System.Data.Common.DbDataReader! reader, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask<Open.Database.Extensions.Core.QueryResultQueue<object![]!>!>
408408
static Open.Database.Extensions.CoreExtensions.RetrieveAsync(this System.Data.Common.DbDataReader! reader, System.Threading.CancellationToken cancellationToken, int n, params System.Collections.Generic.IEnumerable<int>! others) -> System.Threading.Tasks.ValueTask<Open.Database.Extensions.Core.QueryResultQueue<object![]!>!>
409409
static Open.Database.Extensions.CoreExtensions.RetrieveAsync(this System.Data.Common.DbDataReader! reader, System.Threading.CancellationToken cancellationToken, string! c, params System.Collections.Generic.IEnumerable<string!>! others) -> System.Threading.Tasks.ValueTask<Open.Database.Extensions.Core.QueryResultQueue<object![]!>!>
410-
static Open.Database.Extensions.CoreExtensions.To<T>(this System.Data.DataTable! table, params (string! Field, string? Column)[]! fieldMappingOverrides) -> System.Collections.Generic.IEnumerable<T>!
410+
static Open.Database.Extensions.CoreExtensions.To<T>(this System.Data.DataTable! table, params System.Collections.Generic.IEnumerable<(string! Field, string? Column)>! fieldMappingOverrides) -> System.Collections.Generic.IEnumerable<T>!
411411
static Open.Database.Extensions.CoreExtensions.To<T>(this System.Data.DataTable! table, System.Collections.Generic.IEnumerable<(string! Field, string? Column)>? fieldMappingOverrides, bool clearSourceTable = false) -> System.Collections.Generic.IEnumerable<T>!
412412
static Open.Database.Extensions.CoreExtensions.To<T>(this System.Data.DataTable! table, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, string?>>? fieldMappingOverrides, bool clearSourceTable = false) -> System.Collections.Generic.IEnumerable<T>!
413413
static Open.Database.Extensions.DataReaderExtensions.AsAsyncEnumerable(this System.Data.Common.DbDataReader! reader, int n, params System.Collections.Generic.IEnumerable<int>! others) -> System.Collections.Generic.IAsyncEnumerable<object![]!>!

0 commit comments

Comments
 (0)