diff --git a/Connectors/src/MySql/Controllers/HomeController.cs b/Connectors/src/MySql/Controllers/HomeController.cs index 23bc65bb6..10e5d31ef 100644 --- a/Connectors/src/MySql/Controllers/HomeController.cs +++ b/Connectors/src/MySql/Controllers/HomeController.cs @@ -1,16 +1,15 @@ using System.Data.Common; using System.Diagnostics; using Microsoft.AspNetCore.Mvc; -using MySqlConnector; using Steeltoe.Connectors; using Steeltoe.Connectors.MySql; using Steeltoe.Samples.MySql.Models; namespace Steeltoe.Samples.MySql.Controllers; -public sealed class HomeController(ConnectorFactory connector) : Controller +public sealed class HomeController(ConnectorFactory connector) : Controller { - private readonly Connector _connector = connector.Get(); + private readonly Connector _connector = connector.Get(); public async Task Index(CancellationToken cancellationToken) { @@ -20,9 +19,9 @@ public async Task Index(CancellationToken cancellationToken) ConnectionString = _connector.Options.ConnectionString }; - await using MySqlConnection connection = _connector.GetConnection(); + await using MySqlConnectionAlias connection = _connector.GetConnection(); await connection.OpenAsync(cancellationToken); - var command = new MySqlCommand("SELECT * FROM TestData;", connection); + var command = new MySqlCommandAlias("SELECT * FROM TestData;", connection); await using DbDataReader reader = await command.ExecuteReaderAsync(cancellationToken); while (await reader.ReadAsync(cancellationToken)) diff --git a/Connectors/src/MySql/MySqlSeeder.cs b/Connectors/src/MySql/MySqlSeeder.cs index ed246c41f..e118246ea 100644 --- a/Connectors/src/MySql/MySqlSeeder.cs +++ b/Connectors/src/MySql/MySqlSeeder.cs @@ -1,4 +1,3 @@ -using MySqlConnector; using Steeltoe.Connectors; using Steeltoe.Connectors.MySql; @@ -8,8 +7,8 @@ internal sealed class MySqlSeeder { public static async Task CreateSampleDataAsync(IServiceProvider serviceProvider) { - var connectorFactory = serviceProvider.GetRequiredService>(); - await using MySqlConnection connection = connectorFactory.Get().GetConnection(); + var connectorFactory = serviceProvider.GetRequiredService>(); + await using MySqlConnectionAlias connection = connectorFactory.Get().GetConnection(); await connection.OpenAsync(); @@ -17,21 +16,21 @@ public static async Task CreateSampleDataAsync(IServiceProvider serviceProvider) await InsertSampleDataAsync(connection); } - private static async Task DropCreateTableAsync(MySqlConnection connection) + private static async Task DropCreateTableAsync(MySqlConnectionAlias connection) { - var dropCommand = new MySqlCommand("DROP TABLE IF EXISTS TestData;", connection); + var dropCommand = new MySqlCommandAlias("DROP TABLE IF EXISTS TestData;", connection); await dropCommand.ExecuteNonQueryAsync(); - var createCommand = new MySqlCommand("CREATE TABLE IF NOT EXISTS TestData(Id INT PRIMARY KEY, MyText VARCHAR(255));", connection); + var createCommand = new MySqlCommandAlias("CREATE TABLE IF NOT EXISTS TestData(Id INT PRIMARY KEY, MyText VARCHAR(255));", connection); await createCommand.ExecuteNonQueryAsync(); } - private static async Task InsertSampleDataAsync(MySqlConnection connection) + private static async Task InsertSampleDataAsync(MySqlConnectionAlias connection) { - var insertCommand1 = new MySqlCommand("INSERT INTO TestData(Id, MyText) VALUES(1, 'Row1 Text');", connection); + var insertCommand1 = new MySqlCommandAlias("INSERT INTO TestData(Id, MyText) VALUES(1, 'Row1 Text');", connection); await insertCommand1.ExecuteNonQueryAsync(); - var insertCommand2 = new MySqlCommand("INSERT INTO TestData(Id, MyText) VALUES(2, 'Row2 Text');", connection); + var insertCommand2 = new MySqlCommandAlias("INSERT INTO TestData(Id, MyText) VALUES(2, 'Row2 Text');", connection); await insertCommand2.ExecuteNonQueryAsync(); } } diff --git a/Connectors/src/MySql/Program.cs b/Connectors/src/MySql/Program.cs index 831d3a984..aa7a73c5f 100644 --- a/Connectors/src/MySql/Program.cs +++ b/Connectors/src/MySql/Program.cs @@ -1,4 +1,3 @@ -using MySqlConnector; using Steeltoe.Configuration.CloudFoundry; using Steeltoe.Connectors.MySql; using Steeltoe.Management.Endpoint.Actuators.All; @@ -21,7 +20,7 @@ // Steeltoe: optionally change the MySQL connection string at runtime. builder.Services.Configure(options => { - var connectionStringBuilder = new MySqlConnectionStringBuilder + var connectionStringBuilder = new MySqlConnectionStringBuilderAlias { ConnectionString = options.ConnectionString, UseCompression = false diff --git a/Connectors/src/MySql/Steeltoe.Samples.MySql.csproj b/Connectors/src/MySql/Steeltoe.Samples.MySql.csproj index 79ba1cf5d..80c92cf9b 100644 --- a/Connectors/src/MySql/Steeltoe.Samples.MySql.csproj +++ b/Connectors/src/MySql/Steeltoe.Samples.MySql.csproj @@ -4,17 +4,22 @@ net10.0 enable enable + false - - - - + + + + + + + + + + diff --git a/Connectors/src/MySqlEFCore/Program.cs b/Connectors/src/MySqlEFCore/Program.cs index 8b595718b..2f5c3ac6e 100644 --- a/Connectors/src/MySqlEFCore/Program.cs +++ b/Connectors/src/MySqlEFCore/Program.cs @@ -1,4 +1,3 @@ -using MySql.EntityFrameworkCore.Infrastructure; using Steeltoe.Configuration.CloudFoundry; using Steeltoe.Connectors.EntityFrameworkCore.MySql; using Steeltoe.Connectors.MySql; @@ -36,13 +35,13 @@ // Steeltoe: Setup DbContext connection strings, optionally changing MySQL options at runtime. builder.Services.AddDbContext((serviceProvider, options) => options.UseMySql(serviceProvider, serviceOneName, null, untypedOptions => { - var mySqlOptions = (MySQLDbContextOptionsBuilder)untypedOptions; + var mySqlOptions = (MySqlDbContextOptionsBuilderAlias)untypedOptions; mySqlOptions.CommandTimeout(20); })); builder.Services.AddDbContext((serviceProvider, options) => options.UseMySql(serviceProvider, serviceTwoName, null, untypedOptions => { - var mySqlOptions = (MySQLDbContextOptionsBuilder)untypedOptions; + var mySqlOptions = (MySqlDbContextOptionsBuilderAlias)untypedOptions; mySqlOptions.CommandTimeout(25); })); } @@ -54,7 +53,7 @@ // Steeltoe: Setup DbContext connection string, optionally changing MySQL options at runtime. builder.Services.AddDbContext((serviceProvider, options) => options.UseMySql(serviceProvider, null, null, untypedOptions => { - var mySqlOptions = (MySQLDbContextOptionsBuilder)untypedOptions; + var mySqlOptions = (MySqlDbContextOptionsBuilderAlias)untypedOptions; mySqlOptions.CommandTimeout(15); })); } diff --git a/Connectors/src/MySqlEFCore/Steeltoe.Samples.MySqlEFCore.csproj b/Connectors/src/MySqlEFCore/Steeltoe.Samples.MySqlEFCore.csproj index b9b098647..8e81a5b43 100644 --- a/Connectors/src/MySqlEFCore/Steeltoe.Samples.MySqlEFCore.csproj +++ b/Connectors/src/MySqlEFCore/Steeltoe.Samples.MySqlEFCore.csproj @@ -4,17 +4,21 @@ net10.0 enable enable + false - - - - + + + + + + + diff --git a/Management/src/ActuatorApi/Directory.Build.props b/Management/src/ActuatorApi/Directory.Build.props index bd75a3e70..f11087a62 100644 --- a/Management/src/ActuatorApi/Directory.Build.props +++ b/Management/src/ActuatorApi/Directory.Build.props @@ -4,10 +4,7 @@ 10.0.* - - - 9.0.* - + 10.0.* 1.15.* diff --git a/Management/src/ActuatorApi/Steeltoe.Samples.ActuatorApi.csproj b/Management/src/ActuatorApi/Steeltoe.Samples.ActuatorApi.csproj index ee6308d07..17444d910 100644 --- a/Management/src/ActuatorApi/Steeltoe.Samples.ActuatorApi.csproj +++ b/Management/src/ActuatorApi/Steeltoe.Samples.ActuatorApi.csproj @@ -14,12 +14,12 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all + -