Files
2026-04-27 18:47:39 -04:00

18 lines
461 B
C#

using System.Data.Common;
using Infrastructure.Repository.Sql;
namespace Infrastructure.Repository;
public abstract class Repository<T>(ISqlConnectionFactory connectionFactory)
where T : class
{
protected async Task<DbConnection> CreateConnection()
{
var connection = connectionFactory.CreateConnection();
await connection.OpenAsync();
return connection;
}
protected abstract T MapToEntity(DbDataReader reader);
}