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.
This commit is contained in:
@@ -12,6 +12,8 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
|||||||
|
|
||||||
public DbSet<ProfileView> ProfileViews { get; set; }
|
public DbSet<ProfileView> ProfileViews { get; set; }
|
||||||
|
|
||||||
|
public DbSet<RecResultView> RecResultViews { get; set; }
|
||||||
|
|
||||||
public DbSet<OutRes> OutRes { get; set; }
|
public DbSet<OutRes> OutRes { get; set; }
|
||||||
|
|
||||||
public DbSet<HeaderQueryResult> HeaderQueryResults { get; set; }
|
public DbSet<HeaderQueryResult> HeaderQueryResults { get; set; }
|
||||||
@@ -261,6 +263,25 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
|||||||
b.Property(e => e.ErrorActionName).HasColumnName("ERROR_ACTION");
|
b.Property(e => e.ErrorActionName).HasColumnName("ERROR_ACTION");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<RecResultView>(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<HeaderQueryResult>(b =>
|
modelBuilder.Entity<HeaderQueryResult>(b =>
|
||||||
{
|
{
|
||||||
b.HasNoKey();
|
b.HasNoKey();
|
||||||
|
|||||||
Reference in New Issue
Block a user