using Microsoft.Extensions.DependencyInjection; using OAService.Infrastructure.DAL.Repository; using StandManager.Domain.Entita; using StandManager.Infrastructure.DAL.Context; namespace StandManager.Service.Repository; public class StandManagerUnitOfWork : UnitOfWork, IStandManagerUnitOfWork { private readonly StandManagerDbContext _context; private readonly IServiceProvider _provider; public StandManagerUnitOfWork(StandManagerDbContext context, IServiceProvider provider) : base(context, provider) { _context = context; _provider = provider; } public override IStandManagerGenericRepository GetRepository() where TEntity : class { return _provider.GetRequiredService>(); } private IStandManagerGenericRepository _utenteRepository; public new IStandManagerGenericRepository UtenteRepository => _utenteRepository ??= new StandManagerGenericRepository(_context); }