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:
@@ -1,9 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
namespace ReC.Domain.Entities;
|
||||||
|
|
||||||
namespace ReC.Domain.Entities;
|
|
||||||
|
|
||||||
public class BodyQueryResult
|
public class BodyQueryResult
|
||||||
{
|
{
|
||||||
[Column("REQUEST_BODY")]
|
|
||||||
public string? RawBody { get; init; }
|
public string? RawBody { get; init; }
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,11 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
|||||||
|
|
||||||
modelBuilder.Entity<HeaderQueryResult>().HasNoKey();
|
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>()
|
modelBuilder.Entity<RecAction>()
|
||||||
.HasOne(act => act.OutRes)
|
.HasOne(act => act.OutRes)
|
||||||
|
|||||||
Reference in New Issue
Block a user