diff --git a/src/EFCore.PG/Storage/Internal/INpgsqlRelationalConnection.cs b/src/EFCore.PG/Storage/Internal/INpgsqlRelationalConnection.cs index f8f62958f..50e44512c 100644 --- a/src/EFCore.PG/Storage/Internal/INpgsqlRelationalConnection.cs +++ b/src/EFCore.PG/Storage/Internal/INpgsqlRelationalConnection.cs @@ -32,5 +32,5 @@ public interface INpgsqlRelationalConnection : IRelationalConnection /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// - ValueTask CloneWith(string connectionString, bool async, CancellationToken cancellationToken = default); + ValueTask CloneWith(string connectionString, bool async, CancellationToken cancellationToken = default); } diff --git a/src/EFCore.PG/Storage/Internal/NpgsqlDatabaseCreator.cs b/src/EFCore.PG/Storage/Internal/NpgsqlDatabaseCreator.cs index 4034f5ef2..379fd7c67 100644 --- a/src/EFCore.PG/Storage/Internal/NpgsqlDatabaseCreator.cs +++ b/src/EFCore.PG/Storage/Internal/NpgsqlDatabaseCreator.cs @@ -215,12 +215,12 @@ private async Task Exists(bool async, CancellationToken cancellationToken { if (async) { - await unpooledRelationalConnection.OpenAsync(errorsExpected: true, cancellationToken: cancellationToken) + await unpooledRelationalConnection.OpenAsync(cancellationToken: cancellationToken) .ConfigureAwait(false); } else { - unpooledRelationalConnection.Open(errorsExpected: true); + unpooledRelationalConnection.Open(); } return true; diff --git a/src/EFCore.PG/Storage/Internal/NpgsqlRelationalConnection.cs b/src/EFCore.PG/Storage/Internal/NpgsqlRelationalConnection.cs index 89df883b0..54ce7039a 100644 --- a/src/EFCore.PG/Storage/Internal/NpgsqlRelationalConnection.cs +++ b/src/EFCore.PG/Storage/Internal/NpgsqlRelationalConnection.cs @@ -232,7 +232,7 @@ public override Transaction? CurrentAmbientTransaction /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// - public virtual async ValueTask CloneWith( + public virtual async ValueTask CloneWith( string connectionString, bool async, CancellationToken cancellationToken = default) @@ -241,13 +241,6 @@ public virtual async ValueTask CloneWith( ? await DbConnection.CloneWithAsync(connectionString, cancellationToken).ConfigureAwait(false) : DbConnection.CloneWith(connectionString); - var relationalOptions = RelationalOptionsExtension.Extract(Dependencies.ContextOptions) - .WithConnectionString(null) - .WithConnection(clonedDbConnection); - - var optionsBuilder = new DbContextOptionsBuilder(); - ((IDbContextOptionsBuilderInfrastructure)optionsBuilder).AddOrUpdateExtension(relationalOptions); - - return new NpgsqlRelationalConnection(Dependencies with { ContextOptions = optionsBuilder.Options }, dataSource: null); + return clonedDbConnection; } }