Update DbRepository to require IRepository constraint
The `DbRepository` class now enforces that the generic type parameter `TDbContext` must implement the `IRepository` interface in addition to inheriting from `DbContext`. This ensures that `DbRepository` can leverage functionality provided by the `IRepository` interface, improving type safety and consistency.
This commit is contained in:
@@ -14,7 +14,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace DigitalData.Core.Infrastructure
|
namespace DigitalData.Core.Infrastructure
|
||||||
{
|
{
|
||||||
public class DbRepository<TDbContext> where TDbContext : DbContext
|
public class DbRepository<TDbContext> where TDbContext : DbContext, IRepository
|
||||||
{
|
{
|
||||||
protected internal readonly TDbContext Context;
|
protected internal readonly TDbContext Context;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user