44using Npgsql ;
55using System . Collections . Concurrent ;
66using System . Data ;
7+ using System . Data . Common ;
78
89namespace CmdScale . EntityFrameworkCore . TimescaleDB . FunctionalTests . Utils ;
910
@@ -20,14 +21,14 @@ public static TimescaleTestStore Create(string name, string connectionString)
2021 => new ( name , shared : false , connectionString ) ;
2122
2223 public static TimescaleTestStore GetOrCreateShared ( string name , string connectionString )
23- => _sharedStores . GetOrAdd ( name , _ =>
24+ => _sharedStores . GetOrAdd ( name , key =>
2425 {
2526 TimescaleTestStore store = new ( name , shared : true , connectionString ) ;
2627
2728 DbContextOptions < MigrationsInfrastructureFixtureBase . MigrationsContext > options =
2829 new DbContextOptionsBuilder < MigrationsInfrastructureFixtureBase . MigrationsContext > ( )
2930 . UseNpgsql ( connectionString ) . UseTimescaleDb ( ) . Options ;
30- var __ = store . InitializeAsync ( null ,
31+ _ = store . InitializeAsync ( null ,
3132 ( ) => new MigrationsInfrastructureFixtureBase . MigrationsContext ( options ) , null ) . Result ;
3233 return store ;
3334 } ) ;
@@ -47,10 +48,8 @@ public void ExecuteScript(string script)
4748 if ( ConnectionState != ConnectionState . Open )
4849 Connection . Open ( ) ;
4950
50- using ( var cmd = Connection . CreateCommand ( ) )
51- {
52- cmd . CommandText = script ;
53- cmd . ExecuteNonQuery ( ) ;
54- }
51+ using DbCommand cmd = Connection . CreateCommand ( ) ;
52+ cmd . CommandText = script ;
53+ cmd . ExecuteNonQuery ( ) ;
5554 }
5655}
0 commit comments