Skip to content

Commit ff44b90

Browse files
Add conditional method signature for RetrieveAsync
Introduces a conditional compilation directive for .NET 8.0 or greater. If the framework is .NET 8.0+, `RetrieveAsync` accepts a string and an array of `IEnumerable<string>`. Otherwise, it retains the existing signature with a string and an array of strings, enhancing flexibility in handling column names based on the framework version.
1 parent 95210cd commit ff44b90

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Source/Core/ExpressiveDbCommandBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,13 @@ public ValueTask<QueryResultQueue<object[]>> RetrieveAsync(int n, params int[] o
221221
/// <param name="c">The first column name to include in the request to the reader for each record.</param>
222222
/// <param name="others">The remaining column names to request from the reader for each record.</param>
223223
/// <returns>The QueryResult that contains all the results and the column mappings.</returns>
224+
#if NET8_0_OR_GREATER
225+
public ValueTask<QueryResultQueue<object[]>> RetrieveAsync(string c, params IEnumerable<string> others)
226+
=> RetrieveAsync(others.Prepend(c));
227+
#else
224228
public ValueTask<QueryResultQueue<object[]>> RetrieveAsync(string c, params string[] others)
225229
=> RetrieveAsync(Concat(c, others));
230+
#endif
226231

227232
/// <summary>
228233
/// Asynchronously returns all records via a transform function.

0 commit comments

Comments
 (0)