refactor(DbRepositoryFactory): remvoed

This commit is contained in:
2025-10-22 17:26:31 +02:00
parent 3b825d4ea3
commit 1febae72c2
4 changed files with 6 additions and 53 deletions

View File

@@ -4,6 +4,8 @@ using DigitalData.Core.Abstractions.Interfaces;
using DigitalData.Core.Infrastructure.Factory;
using Microsoft.EntityFrameworkCore;
using System.Linq.Expressions;
using Microsoft.Extensions.DependencyInjection;
#if NETFRAMEWORK
using System.Collections.Generic;
using System;
@@ -130,14 +132,14 @@ public class DbRepository<TDbContext, TEntity> : IRepository<TEntity> where TDbC
public class DbRepository : IRepository
{
private readonly IRepositoryFactory _factory;
private readonly IServiceProvider _provider;
public DbRepository(IRepositoryFactory factory)
public DbRepository(IServiceProvider provider)
{
_factory = factory;
_provider = provider;
}
public IRepository<TEntity> Entity<TEntity>() where TEntity : IEntity => _factory.Get<TEntity>();
public IRepository<TEntity> Entity<TEntity>() where TEntity : IEntity => _provider.GetRequiredService<IRepository<TEntity>>();
}
#if NETFRAMEWORK