From 538abec212ae6ec3c3132d1224ca8e89ab60e3c6 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 15 Jan 2026 23:59:13 +0100 Subject: [PATCH] Add entity configurations and suppress obsolete warnings Introduced entity configurations in `RecDbContext` for `Connection`, `Endpoint`, `EndpointAuth`, `EndpointParam`, `OutRes`, `Profile`, `ProfileView`, `RecAction`, and `RecActionView`. Mapped entities to corresponding tables or views with column configurations. Added relationships: - `Profile` to `Actions` (one-to-many). - `RecAction` to `OutRes` (one-to-one with cascade delete). Suppressed CS0618 warnings in `OnModelCreating` to handle obsolete members. --- src/ReC.Infrastructure/RecDbContext.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ReC.Infrastructure/RecDbContext.cs b/src/ReC.Infrastructure/RecDbContext.cs index 3331f72..96cd243 100644 --- a/src/ReC.Infrastructure/RecDbContext.cs +++ b/src/ReC.Infrastructure/RecDbContext.cs @@ -48,6 +48,7 @@ public class RecDbContext(DbContextOptions options) : DbContext(op { base.OnModelCreating(modelBuilder); +#pragma warning disable CS0618 // Type or member is obsolete modelBuilder.Entity(b => { b.ToTable("TBDD_CONNECTION"); @@ -72,7 +73,9 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.GeaendertWann).HasColumnName("GEAENDERTWANN"); b.Property(e => e.SysConnection).HasColumnName("SYS_CONNECTION"); }); +#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning disable CS0618 // Type or member is obsolete modelBuilder.Entity(b => { b.ToTable("TBREC_CFG_ENDPOINT"); @@ -91,7 +94,9 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.ChangedWho).HasColumnName("CHANGED_WHO"); b.Property(e => e.ChangedWhen).HasColumnName("CHANGED_WHEN"); }); +#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning disable CS0618 // Type or member is obsolete modelBuilder.Entity(b => { b.ToTable("TBREC_CFG_ENDPOINT_AUTH"); @@ -118,7 +123,9 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.ChangedWho).HasColumnName("CHANGED_WHO"); b.Property(e => e.ChangedWhen).HasColumnName("CHANGED_WHEN"); }); +#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning disable CS0618 // Type or member is obsolete modelBuilder.Entity(b => { b.ToTable("TBREC_CFG_ENDPOINT_PARAMS", "dbo"); @@ -137,7 +144,9 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.ChangedWho).HasColumnName("CHANGED_WHO"); b.Property(e => e.ChangedWhen).HasColumnName("CHANGED_WHEN"); }); +#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning disable CS0618 // Type or member is obsolete modelBuilder.Entity(b => { b.ToTable("TBREC_OUT_RESULT", "dbo"); @@ -157,7 +166,9 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.ChangedWho).HasColumnName("CHANGED_WHO"); b.Property(e => e.ChangedWhen).HasColumnName("CHANGED_WHEN"); }); +#pragma warning restore CS0618 // Type or member is obsolete +#pragma warning disable CS0618 // Type or member is obsolete modelBuilder.Entity(b => { b.ToTable("TBREC_CFG_PROFILE", "dbo"); @@ -180,6 +191,7 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.ChangedWho).HasColumnName("CHANGED_WHO"); b.Property(e => e.ChangedWhen).HasColumnName("CHANGED_WHEN"); }); +#pragma warning restore CS0618 // Type or member is obsolete modelBuilder.Entity(b => { @@ -210,6 +222,7 @@ public class RecDbContext(DbContextOptions options) : DbContext(op .HasForeignKey(a => a.ProfileId); }); +#pragma warning disable CS0618 // Type or member is obsolete modelBuilder.Entity(b => { b.ToTable("TBREC_CFG_ACTION"); @@ -240,6 +253,7 @@ public class RecDbContext(DbContextOptions options) : DbContext(op .HasForeignKey(res => res.ActionId) .OnDelete(DeleteBehavior.Cascade); }); +#pragma warning restore CS0618 // Type or member is obsolete modelBuilder.Entity(b => {