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.
This commit is contained in:
@@ -48,6 +48,7 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
modelBuilder.Entity<Connection>(b =>
|
||||
{
|
||||
b.ToTable("TBDD_CONNECTION");
|
||||
@@ -72,7 +73,9 @@ public class RecDbContext(DbContextOptions<RecDbContext> 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<Endpoint>(b =>
|
||||
{
|
||||
b.ToTable("TBREC_CFG_ENDPOINT");
|
||||
@@ -91,7 +94,9 @@ public class RecDbContext(DbContextOptions<RecDbContext> 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<EndpointAuth>(b =>
|
||||
{
|
||||
b.ToTable("TBREC_CFG_ENDPOINT_AUTH");
|
||||
@@ -118,7 +123,9 @@ public class RecDbContext(DbContextOptions<RecDbContext> 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<EndpointParam>(b =>
|
||||
{
|
||||
b.ToTable("TBREC_CFG_ENDPOINT_PARAMS", "dbo");
|
||||
@@ -137,7 +144,9 @@ public class RecDbContext(DbContextOptions<RecDbContext> 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<OutRes>(b =>
|
||||
{
|
||||
b.ToTable("TBREC_OUT_RESULT", "dbo");
|
||||
@@ -157,7 +166,9 @@ public class RecDbContext(DbContextOptions<RecDbContext> 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<Profile>(b =>
|
||||
{
|
||||
b.ToTable("TBREC_CFG_PROFILE", "dbo");
|
||||
@@ -180,6 +191,7 @@ public class RecDbContext(DbContextOptions<RecDbContext> 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<ProfileView>(b =>
|
||||
{
|
||||
@@ -210,6 +222,7 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
||||
.HasForeignKey(a => a.ProfileId);
|
||||
});
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
modelBuilder.Entity<RecAction>(b =>
|
||||
{
|
||||
b.ToTable("TBREC_CFG_ACTION");
|
||||
@@ -240,6 +253,7 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
||||
.HasForeignKey<OutRes>(res => res.ActionId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
modelBuilder.Entity<RecActionView>(b =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user