Move InsertObjectResult mapping to Fluent API
Removed [Column] attribute from InsertObjectResult and configured column mapping for NewObjectId in RecDbContext using the Fluent API. This centralizes entity mapping logic in the DbContext.
This commit is contained in:
@@ -4,6 +4,5 @@ namespace ReC.Domain.QueryOutput;
|
|||||||
|
|
||||||
public class InsertObjectResult
|
public class InsertObjectResult
|
||||||
{
|
{
|
||||||
[Column("oGUID")]
|
|
||||||
public required long NewObjectId { get; set; }
|
public required long NewObjectId { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -314,5 +314,10 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
|
|||||||
b.Property(e => e.RawBody).HasColumnName("REQUEST_BODY");
|
b.Property(e => e.RawBody).HasColumnName("REQUEST_BODY");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<InsertObjectResult>(b =>
|
||||||
|
{
|
||||||
|
b.HasNoKey();
|
||||||
|
b.Property(e => e.NewObjectId).HasColumnName("oGUID");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user