refactor: remove IRepository and DbRepository
This commit is contained in:
@@ -129,19 +129,6 @@ public class DbRepository<TDbContext, TEntity> : IRepository<TEntity> where TDbC
|
||||
public virtual IQueryable<TEntity> ReadOnly() => Entities.AsNoTracking();
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class DbRepository : IRepository
|
||||
{
|
||||
private readonly IServiceProvider _provider;
|
||||
|
||||
public DbRepository(IServiceProvider provider)
|
||||
{
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
public IRepository<TEntity> Entity<TEntity>() where TEntity : IEntity => _provider.GetRequiredService<IRepository<TEntity>>();
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
}
|
||||
#endif
|
||||
@@ -26,9 +26,6 @@ public static class DependencyInjection
|
||||
options.Invoke(cfg);
|
||||
cfg.RegisterAllServices(services);
|
||||
|
||||
// register db repository
|
||||
services.AddSingleton<IRepository, DbRepository>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user