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:
@@ -1,9 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
namespace ReC.Domain.Entities;
|
||||||
|
|
||||||
namespace ReC.Domain.Entities;
|
|
||||||
|
|
||||||
public class HeaderQueryResult
|
public class HeaderQueryResult
|
||||||
{
|
{
|
||||||
[Column("REQUEST_HEADER")]
|
|
||||||
public string? RawHeader { get; init; }
|
public string? RawHeader { get; init; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,11 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
|||||||
b.Property(e => e.PostprocessingQuery).HasColumnName("POSTPROCESSING_QUERY");
|
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 =>
|
modelBuilder.Entity<BodyQueryResult>(b =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user