This commit is contained in:
2025-12-01 09:56:00 +01:00
commit b1bd4f01b6
2237 changed files with 2624728 additions and 0 deletions

View File

@ -0,0 +1,8 @@
using OAService.Service.Repository;
namespace StandManager.Service.Repository;
public interface IStandManagerGenericRepository<T> : IGenericRepository<T> where T : class
{
}

View File

@ -0,0 +1,9 @@
using OAService.Service.Repository;
using StandManager.Domain.Entita;
namespace StandManager.Service.Repository;
public interface IStandManagerUnitOfWork : IUnitOfWork
{
public IStandManagerGenericRepository<Utente> UtenteRepository { get; }
}

View File

@ -0,0 +1,11 @@
using OAService.Infrastructure.DAL.Repository;
using StandManager.Infrastructure.DAL.Context;
namespace StandManager.Service.Repository;
public class StandManagerGenericRepository<T> : GenericRepository<T>, IStandManagerGenericRepository<T> where T : class
{
public StandManagerGenericRepository(StandManagerDbContext context) : base(context)
{
}
}

View File

@ -0,0 +1,27 @@
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<TEntity> GetRepository<TEntity>() where TEntity : class
{
return _provider.GetRequiredService<IStandManagerGenericRepository<TEntity>>();
}
private IStandManagerGenericRepository<Utente> _utenteRepository;
public new IStandManagerGenericRepository<Utente> UtenteRepository => _utenteRepository ??= new StandManagerGenericRepository<Utente>(_context);
}