1- using MySqlConnector ;
21using Steeltoe . Connectors ;
32using Steeltoe . Connectors . MySql ;
43
@@ -8,30 +7,30 @@ internal sealed class MySqlSeeder
87{
98 public static async Task CreateSampleDataAsync ( IServiceProvider serviceProvider )
109 {
11- var connectorFactory = serviceProvider . GetRequiredService < ConnectorFactory < MySqlOptions , MySqlConnection > > ( ) ;
12- await using MySqlConnection connection = connectorFactory . Get ( ) . GetConnection ( ) ;
10+ var connectorFactory = serviceProvider . GetRequiredService < ConnectorFactory < MySqlOptions , MySqlConnectionAlias > > ( ) ;
11+ await using MySqlConnectionAlias connection = connectorFactory . Get ( ) . GetConnection ( ) ;
1312
1413 await connection . OpenAsync ( ) ;
1514
1615 await DropCreateTableAsync ( connection ) ;
1716 await InsertSampleDataAsync ( connection ) ;
1817 }
1918
20- private static async Task DropCreateTableAsync ( MySqlConnection connection )
19+ private static async Task DropCreateTableAsync ( MySqlConnectionAlias connection )
2120 {
22- var dropCommand = new MySqlCommand ( "DROP TABLE IF EXISTS TestData;" , connection ) ;
21+ var dropCommand = new MySqlCommandAlias ( "DROP TABLE IF EXISTS TestData;" , connection ) ;
2322 await dropCommand . ExecuteNonQueryAsync ( ) ;
2423
25- var createCommand = new MySqlCommand ( "CREATE TABLE IF NOT EXISTS TestData(Id INT PRIMARY KEY, MyText VARCHAR(255));" , connection ) ;
24+ var createCommand = new MySqlCommandAlias ( "CREATE TABLE IF NOT EXISTS TestData(Id INT PRIMARY KEY, MyText VARCHAR(255));" , connection ) ;
2625 await createCommand . ExecuteNonQueryAsync ( ) ;
2726 }
2827
29- private static async Task InsertSampleDataAsync ( MySqlConnection connection )
28+ private static async Task InsertSampleDataAsync ( MySqlConnectionAlias connection )
3029 {
31- var insertCommand1 = new MySqlCommand ( "INSERT INTO TestData(Id, MyText) VALUES(1, 'Row1 Text');" , connection ) ;
30+ var insertCommand1 = new MySqlCommandAlias ( "INSERT INTO TestData(Id, MyText) VALUES(1, 'Row1 Text');" , connection ) ;
3231 await insertCommand1 . ExecuteNonQueryAsync ( ) ;
3332
34- var insertCommand2 = new MySqlCommand ( "INSERT INTO TestData(Id, MyText) VALUES(2, 'Row2 Text');" , connection ) ;
33+ var insertCommand2 = new MySqlCommandAlias ( "INSERT INTO TestData(Id, MyText) VALUES(2, 'Row2 Text');" , connection ) ;
3534 await insertCommand2 . ExecuteNonQueryAsync ( ) ;
3635 }
3736}
0 commit comments