Refactor DbContext and add IRecDbContext interface
Refactored `DependencyInjection` to use a generic `TRecDbContext` for flexibility and added scoped registration for `IRecDbContext`. Updated `RecDbContext` to implement the new `IRecDbContext` interface, ensuring adherence to the application-layer contract. Introduced the `IRecDbContext` interface in the application layer, defining `DbSet` properties for key entities and a `SaveChangesAsync` method. Updated `ReC.Infrastructure.csproj` to reference the application project for interface access.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ReC.Application.Common.Interfaces;
|
||||
using ReC.Domain.Entities;
|
||||
|
||||
namespace ReC.Infrastructure;
|
||||
|
||||
public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(options)
|
||||
public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(options), IRecDbContext
|
||||
{
|
||||
public DbSet<EndpointParam> EndpointParams { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user