Fase 2: Creatción de la UI (React + Vite). Implementación de Log In reemplazando texto plano. Y creación de tool para migrar contraseñas.
This commit is contained in:
27
tools/PasswordMigrationUtil/DbConnectionFactory.cs
Normal file
27
tools/PasswordMigrationUtil/DbConnectionFactory.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
// En PasswordMigrationUtil/DbConnectionFactory.cs
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.Extensions.Configuration; // Añadir este using
|
||||
using System.Data;
|
||||
|
||||
namespace PasswordMigrationUtil // Ajusta el namespace
|
||||
{
|
||||
public class DbConnectionFactory
|
||||
{
|
||||
private readonly string _connectionString;
|
||||
|
||||
// Cambiamos el constructor para recibir la cadena directamente
|
||||
public DbConnectionFactory(string connectionString)
|
||||
{
|
||||
if (string.IsNullOrEmpty(connectionString))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(connectionString), "Connection string cannot be null or empty.");
|
||||
}
|
||||
_connectionString = connectionString;
|
||||
}
|
||||
|
||||
public IDbConnection CreateConnection()
|
||||
{
|
||||
return new SqlConnection(_connectionString);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user