fix(data): define navigation property for Envelope–Document relationship
Explicitly specify the navigation property `d.Envelope` in the relationship between Envelope and Document to ensure proper entity mapping and navigation in EF Core.
This commit is contained in:
parent
69821e64c6
commit
4abed0e1bc
@ -125,7 +125,7 @@ public abstract class EGDbContextBase : DbContext
|
|||||||
|
|
||||||
modelBuilder.Entity<Envelope>()
|
modelBuilder.Entity<Envelope>()
|
||||||
.HasMany(e => e.Documents)
|
.HasMany(e => e.Documents)
|
||||||
.WithOne()
|
.WithOne(d => d.Envelope)
|
||||||
.HasForeignKey(ed => ed.EnvelopeId);
|
.HasForeignKey(ed => ed.EnvelopeId);
|
||||||
|
|
||||||
modelBuilder.Entity<Envelope>()
|
modelBuilder.Entity<Envelope>()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user