feat(infrastructure): add EF Core context and repository implementations
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using DigitalData.TaskFlow.Infrastructure.Persistence.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DigitalData.TaskFlow.Infrastructure.Persistence;
|
||||
|
||||
/// <summary>
|
||||
/// EF Core DbContext for TaskFlow infrastructure data access.
|
||||
/// </summary>
|
||||
public sealed class TaskFlowDbContext(DbContextOptions<TaskFlowDbContext> options) : DbContext(options)
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the keyless result model used for workflow listing procedure reads.
|
||||
/// </summary>
|
||||
public DbSet<WorkflowListingReadModel> WorkflowListingReadModels => Set<WorkflowListingReadModel>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<WorkflowListingReadModel>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
entity.ToView(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user