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:
tekh 2025-10-15 18:23:43 +02:00
parent 69821e64c6
commit 4abed0e1bc

View File

@ -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>()