Move RawHeader column mapping to Fluent API config

Removed data annotation from HeaderQueryResult and mapped RawHeader to REQUEST_HEADER using Fluent API in RecDbContext. Centralizes entity configuration in the DbContext.
This commit is contained in:
2025-12-10 11:50:55 +01:00
parent 141e77f315
commit 8bc9b85049
2 changed files with 6 additions and 5 deletions

View File

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

View File

@@ -103,7 +103,11 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
b.Property(e => e.PostprocessingQuery).HasColumnName("POSTPROCESSING_QUERY");
});
modelBuilder.Entity<HeaderQueryResult>().HasNoKey();
modelBuilder.Entity<HeaderQueryResult>(b =>
{
b.HasNoKey();
b.Property(e => e.RawHeader).HasColumnName("REQUEST_HEADER");
});
modelBuilder.Entity<BodyQueryResult>(b =>
{