diff --git a/DigitalData.Core.Abstraction.Application/Repository/IRepositoryFactory.cs b/DigitalData.Core.Abstraction.Application/Repository/IRepositoryFactory.cs new file mode 100644 index 0000000..8f16160 --- /dev/null +++ b/DigitalData.Core.Abstraction.Application/Repository/IRepositoryFactory.cs @@ -0,0 +1,6 @@ +namespace DigitalData.Core.Abstraction.Application.Repository; + +public interface IRepositoryFactory +{ + public IRepository Get(); +} \ No newline at end of file diff --git a/DigitalData.Core.Infrastructure/DbRepository.cs b/DigitalData.Core.Infrastructure/DbRepository.cs index a27de93..879353b 100644 --- a/DigitalData.Core.Infrastructure/DbRepository.cs +++ b/DigitalData.Core.Infrastructure/DbRepository.cs @@ -79,12 +79,12 @@ public class DbRepository : IRepository where TDbC public class DbRepository : IRepository { - private readonly IServiceProvider _provider; + private readonly IRepositoryFactory _factory; - public DbRepository(IServiceProvider provider) + public DbRepository(IRepositoryFactory factory) { - _provider = provider; + _factory = factory; } - public IRepository Entity() => _provider.GetRequiredService>(); + public IRepository Entity() => _factory.Get(); } \ No newline at end of file