From edc1de20349a4dd114d64e623a63db0cfbbe3c9a Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 15 Dec 2025 16:33:57 +0100 Subject: [PATCH] Add RecResultView entity and DbSets to RecDbContext Added DbSet properties for RecResultView and OutRes to RecDbContext. Configured entity mapping for RecResultView to the VWREC_RESULT view, including key and property-to-column mappings. This enables querying RecResultView and OutRes through the context. --- src/ReC.Infrastructure/RecDbContext.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ReC.Infrastructure/RecDbContext.cs b/src/ReC.Infrastructure/RecDbContext.cs index fbfb924..ef7c308 100644 --- a/src/ReC.Infrastructure/RecDbContext.cs +++ b/src/ReC.Infrastructure/RecDbContext.cs @@ -12,6 +12,8 @@ public class RecDbContext(DbContextOptions options) : DbContext(op public DbSet ProfileViews { get; set; } + public DbSet RecResultViews { get; set; } + public DbSet OutRes { get; set; } public DbSet HeaderQueryResults { get; set; } @@ -261,6 +263,25 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.ErrorActionName).HasColumnName("ERROR_ACTION"); }); + modelBuilder.Entity(b => + { + b.ToView("VWREC_RESULT", "dbo"); + b.HasKey(e => e.Id); + + b.Property(e => e.Id).HasColumnName("RESULT_GUID"); + b.Property(e => e.ActionId).HasColumnName("ACTION_ID"); + b.Property(e => e.ProfileId).HasColumnName("PROFILE_ID"); + b.Property(e => e.ProfileName).HasColumnName("PROFILE_NAME"); + b.Property(e => e.StatusId).HasColumnName("STATUS_ID"); + b.Property(e => e.Status).HasColumnName("STATUS"); + b.Property(e => e.ResultHeader).HasColumnName("RESULT_HEADER"); + b.Property(e => e.ResultBody).HasColumnName("RESULT_BODY"); + b.Property(e => e.AddedWho).HasColumnName("ADDED_WHO"); + b.Property(e => e.AddedWhen).HasColumnName("ADDED_WHEN"); + b.Property(e => e.ChangedWho).HasColumnName("CHANGED_WHO"); + b.Property(e => e.ChangedWhen).HasColumnName("CHANGED_WHEN"); + }); + modelBuilder.Entity(b => { b.HasNoKey();