using System.Data.Common; using FruityFoundation.DataAccess.Abstractions; using Microsoft.Extensions.DependencyInjection; namespace FruityFoundation.DataAccess.Core; public class DbConnectionFactory : IDbConnectionFactory { private readonly IServiceProvider _serviceProvider; public DbConnectionFactory(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; } public INonTransactionalDbConnection CreateConnection() { var nonTxConnection = _serviceProvider.GetRequiredService>(); return nonTxConnection; } public INonTransactionalDbConnection CreateReadOnlyConnection() { var nonTxConnection = _serviceProvider.GetRequiredService>(); return nonTxConnection; } }