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