diff --git a/Source/Channel/ToChannel.Target.cs b/Source/Channel/ToChannel.Target.cs index aa384574..c7629a37 100644 --- a/Source/Channel/ToChannel.Target.cs +++ b/Source/Channel/ToChannel.Target.cs @@ -65,6 +65,7 @@ public static ValueTask ToChannel( bool complete, CancellationToken cancellationToken = default) { + // The source is guarded by the ChannelWriter overload. if (channel is null) throw new ArgumentNullException(nameof(channel)); Contract.EndContractBlock(); diff --git a/Source/Core/ChunkStream.cs b/Source/Core/ChunkStream.cs index 8cfd0d22..b1d487cb 100644 --- a/Source/Core/ChunkStream.cs +++ b/Source/Core/ChunkStream.cs @@ -116,11 +116,7 @@ public IAsyncEnumerator> GetAsyncEnumerator( // The one-shot guard is here, not in the iterator: an iterator body runs // at the first step, and the second call must throw at the call. if (Interlocked.Exchange(ref _taken, 1) != 0) - { - throw new InvalidOperationException( - "This stream can be enumerated only once." - + " Call ToPooledBuffer() to read it many times."); - } + throw StallStream.EnumeratedTwice(); return Read(cancellationToken); } diff --git a/Source/Core/Core/RowMap.cs b/Source/Core/Core/RowMap.cs index b371b712..a1b7c331 100644 --- a/Source/Core/Core/RowMap.cs +++ b/Source/Core/Core/RowMap.cs @@ -849,8 +849,8 @@ internal static void ThrowIfUnmappable() // A column a member declares by ordinal ([Column(Order = n)]) is its before any tier runs, so none gives it away; a column that is not its throws. int claimed = HasDecorators ? ClaimOrdinals(names, feeds, filled) : 0; - int unmatched = names.Length - claimed - Feed(ColumnIndex(StringComparer.Ordinal), names, feeds, filled); - if (unmatched > 0) unmatched -= Feed(ColumnIndex(StringComparer.OrdinalIgnoreCase), names, feeds, filled); + int unmatched = names.Length - claimed - Feed(OrdinalsByName(StringComparer.Ordinal), names, feeds, filled); + if (unmatched > 0) unmatched -= Feed(OrdinalsByName(StringComparer.OrdinalIgnoreCase), names, feeds, filled); if (unmatched > 0 && NameIndex(filled) is { } byName) Feed(byName, names, feeds, filled); return feeds; @@ -884,7 +884,7 @@ int Feed(Dictionary index, string[] names, Slot?[] feeds, bool[] fi /// /// A member that declares its column ([Column(Name)]) is asked first: another member reading the same name does not take it. /// - Dictionary ColumnIndex(StringComparer comparer) + Dictionary OrdinalsByName(StringComparer comparer) { var index = new Dictionary(_columns.Length, comparer); diff --git a/Source/Core/Extensions/Command.AddParameter.cs b/Source/Core/Extensions/Command.AddParameter.cs index 152db228..e0c86103 100644 --- a/Source/Core/Extensions/Command.AddParameter.cs +++ b/Source/Core/Extensions/Command.AddParameter.cs @@ -185,15 +185,17 @@ public static IDbDataParameter AddParameterType( /// /// /// - /// The optional name of the parameter. + /// The optional name of the parameter. It is ignored if it is , empty, or white space. /// The created parameter, which has already been added to the command's parameter collection. Read its value after the command has executed. /// is . - /// public static IDbDataParameter AddReturnParameter( this IDbCommand target, DbType type, string? name = null) - => target.AddParameterType(name, type, ParameterDirection.ReturnValue); + => target.AddParameterType( + string.IsNullOrWhiteSpace(name) ? null : name, + type, + ParameterDirection.ReturnValue); /// /// Adds a return-value parameter to the command, leaving the provider to determine its type. diff --git a/Source/Core/Extensions/ConnectionProvider.Using.cs b/Source/Core/Extensions/ConnectionProvider.Using.cs index caef2ebd..3fc67e10 100644 --- a/Source/Core/Extensions/ConnectionProvider.Using.cs +++ b/Source/Core/Extensions/ConnectionProvider.Using.cs @@ -187,8 +187,9 @@ public static async ValueTask UsingAsync(this IDbConnectionFactory connect if (action is null) throw new ArgumentNullException(nameof(action)); Contract.EndContractBlock(); - using IDbConnection conn = connectionFactory.Create(); - return await action(conn).ConfigureAwait(false); + var lease = Seal(connectionFactory.Create(), default, null); + await using var leaseDisposal = lease.ConfigureAwait(false); + return await action(lease.Connection).ConfigureAwait(false); } /// @@ -203,8 +204,9 @@ public static async ValueTask UsingAsync(this IDbConnectionFactory connectionFac if (action is null) throw new ArgumentNullException(nameof(action)); Contract.EndContractBlock(); - using IDbConnection conn = connectionFactory.Create(); - await action(conn).ConfigureAwait(false); + var lease = Seal(connectionFactory.Create(), default, null); + await using var leaseDisposal = lease.ConfigureAwait(false); + await action(lease.Connection).ConfigureAwait(false); } /// @@ -222,8 +224,9 @@ public static async ValueTask UsingAsync(this IDbConnectionFa if (action is null) throw new ArgumentNullException(nameof(action)); Contract.EndContractBlock(); - using TConnection conn = connectionFactory.Create(); - return await action(conn).ConfigureAwait(false); + var lease = Seal(connectionFactory.Create(), default, null); + await using var leaseDisposal = lease.ConfigureAwait(false); + return await action(lease.Connection).ConfigureAwait(false); } /// @@ -240,8 +243,9 @@ public static async ValueTask UsingAsync(this IDbConnectionFactory< if (action is null) throw new ArgumentNullException(nameof(action)); Contract.EndContractBlock(); - using TConnection conn = connectionFactory.Create(); - await action(conn).ConfigureAwait(false); + var lease = Seal(connectionFactory.Create(), default, null); + await using var leaseDisposal = lease.ConfigureAwait(false); + await action(lease.Connection).ConfigureAwait(false); } /// @@ -333,8 +337,9 @@ public static async ValueTask UsingAsync(this Func @@ -351,7 +356,8 @@ public static async ValueTask UsingAsync(this Func con if (action is null) throw new ArgumentNullException(nameof(action)); Contract.EndContractBlock(); - using TConnection conn = connectionFactory(); - await action(conn).ConfigureAwait(false); + var lease = Seal(connectionFactory(), default, null); + await using var leaseDisposal = lease.ConfigureAwait(false); + await action(lease.Connection).ConfigureAwait(false); } } diff --git a/Source/Core/IDbConnectionPool.cs b/Source/Core/IDbConnectionPool.cs index 89b073f3..f22db6c9 100644 --- a/Source/Core/IDbConnectionPool.cs +++ b/Source/Core/IDbConnectionPool.cs @@ -1,3 +1,5 @@ +using System.Diagnostics; + namespace Open.Database.Extensions; /// @@ -69,12 +71,20 @@ public static class ConnectionPoolExtensions /// /// Presents a non-generic pool as an of by forwarding to it. /// - /// The pool to forward to. - /// is . - class GenericPool(IDbConnectionPool source) : IDbConnectionPool, IConnectionIdentity + class GenericPool : IDbConnectionPool, IConnectionIdentity { - private readonly IDbConnectionPool _source - = source ?? throw new ArgumentNullException(nameof(source)); + private readonly IDbConnectionPool _source; + + /// + /// Initializes a new instance that forwards to the pool. + /// + /// The pool to forward to. + public GenericPool(IDbConnectionPool source) + { + // Guarded by AsGeneric, the only place that makes one. + Debug.Assert(source is not null); + _source = source; + } /// public IDbConnection Take() @@ -100,5 +110,10 @@ object IConnectionIdentity.Identity /// /// is . public static IDbConnectionPool AsGeneric(this IDbConnectionPool connectionPool) - => connectionPool is IDbConnectionPool p ? p : new GenericPool(connectionPool); + { + if (connectionPool is null) throw new ArgumentNullException(nameof(connectionPool)); + Contract.EndContractBlock(); + + return connectionPool is IDbConnectionPool p ? p : new GenericPool(connectionPool); + } } diff --git a/Source/Core/StallStream.cs b/Source/Core/StallStream.cs index 9d783903..47975ac6 100644 --- a/Source/Core/StallStream.cs +++ b/Source/Core/StallStream.cs @@ -55,10 +55,13 @@ internal static class StallStream public static TimeoutException TimeoutFor(TimeSpan stall) => new($"The consumer made no pull for {stall} while the reader and the connection were held; the read was stopped."); + /// A stream is enumerated a second time. + public const string EnumeratedTwiceMessage + = "This stream can be enumerated only once. " + + "Call ToListAsync() or ToPooledBuffer() to read the rows more than once."; + public static InvalidOperationException EnumeratedTwice() - => new( - "This stream can be enumerated only once." - + " Call ToListAsync() or ToPooledBuffer() to read the rows more than once."); + => new(EnumeratedTwiceMessage); /// /// Gets the buffer size, in rows, unless the caller asks for another one. diff --git a/Source/MSSqlClient/Extensions/Command.AddParameter.cs b/Source/MSSqlClient/Extensions/Command.AddParameter.cs index bba76c7e..129d75d0 100644 --- a/Source/MSSqlClient/Extensions/Command.AddParameter.cs +++ b/Source/MSSqlClient/Extensions/Command.AddParameter.cs @@ -64,11 +64,14 @@ public static SqlParameter AddParameterType( /// /// /// - /// The optional name of the parameter. + /// The optional name of the parameter. It is ignored if it is , empty, or white space. /// The created parameter, which has already been added to the command's parameter collection. Read its value after the command has executed. /// is . - /// public static SqlParameter AddReturnParameter(this SqlCommand target, SqlDbType type, string? name = null) - => AddParameterType(target, name, type, ParameterDirection.ReturnValue); + => AddParameterType( + target, + string.IsNullOrWhiteSpace(name) ? null : name, + type, + ParameterDirection.ReturnValue); } diff --git a/Tests/Open.Database.Extensions.Core.Tests/CaptureStreamTests.cs b/Tests/Open.Database.Extensions.Core.Tests/CaptureStreamTests.cs index 4d646ec3..4bca471f 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/CaptureStreamTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/CaptureStreamTests.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks.Dataflow; +using Open.Database.Extensions.Core; #nullable enable @@ -154,7 +155,7 @@ public static async Task ASecondEnumeration_IsRefused_AndLeavesTheFirstRun() Contains( Assert.Throws( () => rows.GetAsyncEnumerator(Token)), - "can be enumerated only once"); + StallStream.EnumeratedTwiceMessage); Assert.Equal(3, count); Assert.Equal(9, await total); } diff --git a/Tests/Open.Database.Extensions.Core.Tests/CommandParameterExtensionsTests.cs b/Tests/Open.Database.Extensions.Core.Tests/CommandParameterExtensionsTests.cs index 7f14284f..5b7f61b6 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/CommandParameterExtensionsTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/CommandParameterExtensionsTests.cs @@ -51,6 +51,43 @@ public static void AddReturnParameter_SetsReturnDirection() Assert.Equal(ParameterDirection.ReturnValue, param.Direction); } + [Theory] + [InlineData(null)] + [InlineData("")] + [InlineData(" ")] + public static void AddReturnParameter_NullOrBlankName_AddsAnUnnamedParameter( + string? name) + { + (IDbCommand command, IDbDataParameter param, IDataParameterCollection parameters) + = NewCommand(); + param.ParameterName = "unset"; + + command.AddReturnParameter(DbType.Int32, name); + + Assert.Equal("unset", param.ParameterName); + Assert.Equal(DbType.Int32, param.DbType); + Assert.Equal(ParameterDirection.ReturnValue, param.Direction); + parameters.Received(1).Add(param); + } + + [Theory] + [InlineData(null)] + [InlineData("")] + [InlineData(" ")] + public static void AddReturnParameter_Untyped_NullOrBlankName_AddsAnUnnamedParameter( + string? name) + { + (IDbCommand command, IDbDataParameter param, IDataParameterCollection parameters) + = NewCommand(); + param.ParameterName = "unset"; + + command.AddReturnParameter(name); + + Assert.Equal("unset", param.ParameterName); + Assert.Equal(ParameterDirection.ReturnValue, param.Direction); + parameters.Received(1).Add(param); + } + [Fact] public static void AddParameter_BlankName_Throws() { diff --git a/Tests/Open.Database.Extensions.Core.Tests/ConnectionOpenUsingTests.cs b/Tests/Open.Database.Extensions.Core.Tests/ConnectionOpenUsingTests.cs index cecee2f4..8dc1eea0 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/ConnectionOpenUsingTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/ConnectionOpenUsingTests.cs @@ -250,6 +250,39 @@ await Assert.ThrowsAsync(async () => Assert.Equal("Create,DisposeConnection", probe.Log); } + [Fact] + public static async Task FactoryUsingAsync_AsyncDisposableConnection_IsDisposedAsynchronously() + { + int synchronous = 0; + int asynchronous = 0; + var connection = Substitute.For(); + connection.When(c => c.Dispose()).Do(_ => ++synchronous); +#pragma warning disable CA2012 // NSubstitute is told what the call returns here; nothing consumes the ValueTask. + ((IAsyncDisposable)connection).DisposeAsync().Returns(_ => + { + ++asynchronous; + return default; + }); +#pragma warning restore CA2012 + + var factory = Substitute.For(); + factory.Create().Returns(connection); + var generic = Substitute.For>(); + generic.Create().Returns(connection); + Func function = () => connection; + + await factory.UsingAsync(_ => ValueTask.CompletedTask); + await factory.UsingAsync(_ => new ValueTask(1)); + await generic.UsingAsync(_ => ValueTask.CompletedTask); + await generic.UsingAsync(_ => new ValueTask(1)); + await function.UsingAsync(_ => ValueTask.CompletedTask); + await function.UsingAsync(_ => new ValueTask(1)); + + // One asynchronous disposal for each of the six calls, and no other. + Assert.Equal(6, asynchronous); + Assert.Equal(0, synchronous); + } + #endregion #region Argument validation diff --git a/Tests/Open.Database.Extensions.Core.Tests/NameCacheSourceTests.cs b/Tests/Open.Database.Extensions.Core.Tests/NameCacheSourceTests.cs index ab5ad086..a5b1e70e 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/NameCacheSourceTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/NameCacheSourceTests.cs @@ -544,7 +544,7 @@ static string Refusal(Action act) public static void ANullSource_IsRefused_ByNamingTheParameter() { Assert.Equal("ArgumentNullException:connectionFactory", Refusal(() => _ = new ExpressiveCommand((IDbConnectionFactory)null!, CommandType.StoredProcedure, "proc"))); - Assert.Equal("ArgumentNullException:source", Refusal(() => _ = new ExpressiveCommand((IDbConnectionPool)null!, CommandType.StoredProcedure, "proc"))); + Assert.Equal("ArgumentNullException:connectionPool", Refusal(() => _ = new ExpressiveCommand((IDbConnectionPool)null!, CommandType.StoredProcedure, "proc"))); Assert.Equal("ArgumentNullException:connFactory", Refusal(() => _ = new ExpressiveCommand((Func)null!, CommandType.StoredProcedure, "proc"))); } diff --git a/Tests/Open.Database.Extensions.Core.Tests/NullGuardDefectTests.cs b/Tests/Open.Database.Extensions.Core.Tests/NullGuardDefectTests.cs index 8660f6ee..9f67d72b 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/NullGuardDefectTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/NullGuardDefectTests.cs @@ -70,6 +70,15 @@ public static void AsPool_NullSource_NamesTheSource(string call) Assert.Equal("factory", ex.ParamName); } + [Fact] + public static void AsGeneric_NullPool_NamesTheConnectionPool() + { + Assert.Equal("connectionPool", Assert.Throws( + () => ((IDbConnectionPool)null!).AsGeneric()).ParamName); + Assert.Equal("connectionFactory", Assert.Throws( + () => ((IDbConnectionFactory)null!).AsGeneric()).ParamName); + } + [Fact] public static void AsPool_NullFactory_NamesTheFactory() { diff --git a/Tests/Open.Database.Extensions.Core.Tests/ProcedureSchemaNamesTests.cs b/Tests/Open.Database.Extensions.Core.Tests/ProcedureSchemaNamesTests.cs index f2bdfabd..66673903 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/ProcedureSchemaNamesTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/ProcedureSchemaNamesTests.cs @@ -156,15 +156,17 @@ public static async Task Async_FindsTheSameNames() // ---- the procedure name: which restrictions are asked ---- + // These names are not ones ParameterNameHarness.NewProcedure hands out (dbo.namesN): a qualified name + // is remembered for every connection of this kind, so one that another test has used is not read again. [Theory] - [InlineData("names1", null, "names1")] - [InlineData("dbo.names1", "dbo", "names1")] - [InlineData("[dbo].[names1]", "dbo", "names1")] - [InlineData("\"dbo\".\"names1\"", "dbo", "names1")] + [InlineData("split1", null, "split1")] + [InlineData("dbo.split1", "dbo", "split1")] + [InlineData("[dbo].[split1]", "dbo", "split1")] + [InlineData("\"dbo\".\"split1\"", "dbo", "split1")] [InlineData("[my.schema].[my proc]", "my.schema", "my proc")] [InlineData("\"dbo\".\"my.proc\"", "dbo", "my.proc")] [InlineData("[sales].[a]]b]", "sales", "a]b")] - [InlineData("names1;1", null, "names1;1")] // nothing is stripped that the provider could still resolve + [InlineData("split1;1", null, "split1;1")] // nothing is stripped that the provider could still resolve public static void TheProcedureName_IsSplitIntoSchemaAndName_ForTheRestrictions(string procedure, string? schema, string name) { const int orderId = 5; diff --git a/Tests/Open.Database.Extensions.Core.Tests/PumpStreamOpenTests.cs b/Tests/Open.Database.Extensions.Core.Tests/PumpStreamOpenTests.cs index 54cf1ef3..58202084 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/PumpStreamOpenTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/PumpStreamOpenTests.cs @@ -53,6 +53,32 @@ IAsyncEnumerable stream await TakeAndDispose(stream, tally); } + [Fact] + public static void ChunkStream_ASecondEnumeration_SaysWhatToCallInstead() + { + IAsyncEnumerable> stream + = Read(Tally(3)).ToPooledBufferStream(Ct); + stream.GetAsyncEnumerator(Ct); + + var ex = Assert.Throws( + () => stream.GetAsyncEnumerator(Ct)); + + Assert.Equal(StallStream.EnumeratedTwiceMessage, ex.Message); + } + + [Fact] + public static void StallStream_ASecondEnumeration_SaysWhatToCallInstead() + { + IAsyncEnumerable stream + = Read(Tally(3)).StreamBuffered(Long, 1, Ct); + stream.GetAsyncEnumerator(Ct); + + var ex = Assert.Throws( + () => stream.GetAsyncEnumerator(Ct)); + + Assert.Equal(StallStream.EnumeratedTwiceMessage, ex.Message); + } + [Fact] public static async Task CapturedStream_OverChunks_StartsNothing_UntilTheFirstPull() { diff --git a/Tests/Open.Database.Extensions.Core.Tests/SqlServerPackageTests.cs b/Tests/Open.Database.Extensions.Core.Tests/SqlServerPackageTests.cs index 1ff7a8fb..3190ff0d 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/SqlServerPackageTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/SqlServerPackageTests.cs @@ -157,6 +157,20 @@ public static void AddParameterType_ANullNameIsAllowedForTheReturnValue() Assert.StartsWith("Parameter", p.ParameterName); // the collection names a parameter that has no name } + [Theory] + [InlineData("")] + [InlineData(" ")] + public static void AddReturnParameter_ABlankNameIsTheSameAsNone(string name) + { + using var command = new SqlCommand(); + + SqlParameter p = SqlCmd.AddReturnParameter(command, SqlDbType.Int, name); + + Assert.Same(p, Assert.Single(command.Parameters)); + Assert.Equal(ParameterDirection.ReturnValue, p.Direction); + Assert.StartsWith("Parameter", p.ParameterName); // the collection names a parameter that has no name + } + [Fact] public static void AddParameterType_SetsTheTypeAndDirection_AndReturnsTheParameterInTheCollection() { diff --git a/Tests/Open.Database.Extensions.Core.Tests/ToChannelTargetTests.cs b/Tests/Open.Database.Extensions.Core.Tests/ToChannelTargetTests.cs index ad73e7b6..50665b75 100644 --- a/Tests/Open.Database.Extensions.Core.Tests/ToChannelTargetTests.cs +++ b/Tests/Open.Database.Extensions.Core.Tests/ToChannelTargetTests.cs @@ -322,6 +322,19 @@ public static void TheGuards_ThrowAtTheCall() Assert.Empty(tally.Connections); } + [Fact] + public static void WhenEveryArgumentIsNull_EachOverloadNamesItsFirstGuard() + { + IMappedQuery none = null; + + Assert.Equal("channel", Assert.Throws( + () => Drop(none.ToChannel((Channel)null, Ct))).ParamName); + Assert.Equal("channel", Assert.Throws( + () => Drop(none.ToChannel((Channel)null, true, Ct))).ParamName); + Assert.Equal("source", Assert.Throws( + () => Drop(none.ToChannel((ChannelWriter)null, Ct))).ParamName); + } + [Fact] public static async Task AUsersOwnSource_Works() { diff --git a/docsite/articles/release-notes.md b/docsite/articles/release-notes.md index 8a56eecc..14a30e72 100644 --- a/docsite/articles/release-notes.md +++ b/docsite/articles/release-notes.md @@ -9,6 +9,9 @@ Version 11 is `11.0.0-rc.17`. For moving a 10.x codebase, read [Coming from earl - **Fixed: a command made from a factory, a pool or a function read a procedure's parameter names again for every command.** A command made from a factory or pool that implements only the non-generic interface, or from a `Func` or a `Func` through `Command` or `StoredProcedure`, kept a separate cache per command, so the first run of every command asked the database for the names. Commands made from the same factory, pool or function now share one cache. Different factories, pools and functions still do not share. A function is told apart by the object its method belongs to: lambdas that capture nothing, in one class, are one source and share; a lambda that captures a local variable or a parameter and is built again for each call is a new source each time, so keep one factory for the application. See [Parameter names are read once](expressive-commands.md#parameter-names-are-read-once). - **Fixed: a stored procedure's parameter names with an ordinal that is not a number.** A row of the `ProcedureParameters` schema collection whose `ORDINAL_POSITION` is not a number that fits an `int` failed the call that looks up the names; the row is now skipped, and the other parameters are still found. - **Changed: a procedure with a schema in its name has its parameter names read once per server and database, not once per source of connections.** A command or query of the library's own types that runs on a `DbConnection` which reports its server and its database finds the names of `dbo.get_author` there, whichever connection, factory, pool or transaction it was made from, so a connection created for each call no longer asks the database every time. A name without a schema, an answer of no names, a connection that reports no server or database, and a command class of your own stay with the source of the connections, as before. Up to 1024 procedures are shared; past that, new names stay with their source and nothing is dropped. The parameter modes and scales that the output-parameter check reads are shared the same way. The names are shared by every login of the process: see [Parameter names are read once](expressive-commands.md#parameter-names-are-read-once) for what that means. +- **Fixed: `UsingAsync` on a factory or a function disposes the connection asynchronously.** It called `Dispose`; a connection that implements `IAsyncDisposable` (every `DbConnection`) is now disposed with `DisposeAsync`, as the connection scopes do, and any other connection with `Dispose`. +- **Changed: `AddReturnParameter` treats a blank name as no name.** The overload that takes a `DbType` (and the SQL Server one that takes a `SqlDbType`) threw `ArgumentException` for an empty or white-space name; like the overload without a type, it now adds an unnamed return parameter, as it does for `null`. +- **Fixed: the name of the `ArgumentNullException` from `AsGeneric(IDbConnectionPool)`.** A `null` pool threw with the parameter name `source`; it is now `connectionPool`. ### Changes since rc.16