Move BodyQueryResult column mapping to Fluent API

Replaced data annotation with Fluent API configuration for BodyQueryResult.RawBody column mapping in RecDbContext, centralizing entity configuration and removing the [Column("REQUEST_BODY")] attribute from the entity class.
This commit is contained in:
2025-12-10 11:05:09 +01:00
parent 1e62a70866
commit 96fe9c99da
2 changed files with 7 additions and 6 deletions

View File

@@ -1,9 +1,6 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace ReC.Domain.Entities;
namespace ReC.Domain.Entities;
public class BodyQueryResult
{
[Column("REQUEST_BODY")]
public string? RawBody { get; init; }
}
}

View File

@@ -34,7 +34,11 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
modelBuilder.Entity<HeaderQueryResult>().HasNoKey();
modelBuilder.Entity<BodyQueryResult>().HasNoKey();
modelBuilder.Entity<BodyQueryResult>(b =>
{
b.HasNoKey();
b.Property(e => e.RawBody).HasColumnName("REQUEST_BODY");
});
modelBuilder.Entity<RecAction>()
.HasOne(act => act.OutRes)