Skip to content

Commit

Permalink
Mark cloned connections as owned (#1937)
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam authored Dec 8, 2024
1 parent fde6828 commit caa1939
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ public virtual IMySqlRelationalConnection CreateMasterConnection()

// Apply modified connection string.
var masterMySqlOptions = _dataSource is not null
? mySqlOptions.WithConnection(((MySqlConnection)CreateDbConnection()).CloneWith(masterConnectionString))
? mySqlOptions.WithConnection(((MySqlConnection)CreateDbConnection()).CloneWith(masterConnectionString), owned: true)
: mySqlOptions.Connection is null
? mySqlOptions.WithConnectionString(masterConnectionString)
: mySqlOptions.WithConnection(DbConnection.CloneWith(masterConnectionString));
: mySqlOptions.WithConnection(DbConnection.CloneWith(masterConnectionString), owned: true);

var optionsBuilder = new DbContextOptionsBuilder();
var optionsBuilderInfrastructure = (IDbContextOptionsBuilderInfrastructure)optionsBuilder;
Expand Down

0 comments on commit caa1939

Please sign in to comment.