diff --git a/src/ReC.Domain/Entities/ProfileView.cs b/src/ReC.Domain/Entities/ProfileView.cs new file mode 100644 index 0000000..1bb92b2 --- /dev/null +++ b/src/ReC.Domain/Entities/ProfileView.cs @@ -0,0 +1,40 @@ +namespace ReC.Domain.Entities; + +public record ProfileView +{ + public long ProfileGuid { get; init; } + + public bool Active { get; init; } + + public byte TypeId { get; init; } + + public string Type { get; init; } = string.Empty; + + public string Mandantor { get; init; } = string.Empty; + + public string ProfileName { get; init; } = string.Empty; + + public string? Description { get; init; } + + public byte LogLevelId { get; init; } + + public string LogLevel { get; init; } = string.Empty; + + public short LanguageId { get; init; } + + public string Language { get; init; } = string.Empty; + + public string AddedWho { get; init; } = string.Empty; + + public DateTime AddedWhen { get; init; } + + public string? ChangedWho { get; init; } + + public DateTime? ChangedWhen { get; init; } + + public DateTime? FirstRun { get; init; } + + public DateTime? LastRun { get; init; } + + public string? LastResult { get; init; } +} diff --git a/src/ReC.Infrastructure/RecDbContext.cs b/src/ReC.Infrastructure/RecDbContext.cs index a38340b..9c13e9b 100644 --- a/src/ReC.Infrastructure/RecDbContext.cs +++ b/src/ReC.Infrastructure/RecDbContext.cs @@ -10,6 +10,8 @@ public class RecDbContext(DbContextOptions options) : DbContext(op public DbSet RecActionViews { get; set; } + public DbSet ProfileViews { get; set; } + public DbSet OutRes { get; set; } public DbSet HeaderQueryResults { get; set; } @@ -163,6 +165,31 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.ChangedWhen).HasColumnName("CHANGED_WHEN"); }); + modelBuilder.Entity(b => + { + b.ToView("VWREC_PROFILE", "dbo"); + b.HasKey(e => e.ProfileGuid); + + b.Property(e => e.ProfileGuid).HasColumnName("PROFILE_GUID"); + b.Property(e => e.Active).HasColumnName("ACTIVE"); + b.Property(e => e.TypeId).HasColumnName("TYPE_ID"); + b.Property(e => e.Type).HasColumnName("TYPE"); + b.Property(e => e.Mandantor).HasColumnName("MANDANTOR"); + b.Property(e => e.ProfileName).HasColumnName("PROFILE_NAME"); + b.Property(e => e.Description).HasColumnName("DESCRIPTION"); + b.Property(e => e.LogLevelId).HasColumnName("LOG_LEVEL_ID"); + b.Property(e => e.LogLevel).HasColumnName("LOG_LEVEL"); + b.Property(e => e.LanguageId).HasColumnName("LANGUAGE_ID"); + b.Property(e => e.Language).HasColumnName("LANGUAGE"); + 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"); + b.Property(e => e.FirstRun).HasColumnName("FIRST_RUN"); + b.Property(e => e.LastRun).HasColumnName("LAST_RUN"); + b.Property(e => e.LastResult).HasColumnName("LAST_RESULT"); + }); + modelBuilder.Entity(b => { b.ToTable("TBREC_CFG_ACTION");