13 lines
472 B
C#
13 lines
472 B
C#
using MySqlConnector;
|
|
|
|
namespace AVSCartonShipmentVerifier.Data;
|
|
|
|
public sealed class VerificationDbConnectionFactory(IConfiguration configuration) : IVerificationDbConnectionFactory
|
|
{
|
|
private readonly string _connectionString = configuration.GetConnectionString("VerificationDatabase")
|
|
?? throw new InvalidOperationException("Connection string 'VerificationDatabase' is missing.");
|
|
|
|
public MySqlConnection CreateConnection() => new(_connectionString);
|
|
}
|
|
|