diff --git a/src/Heimdall.Application/Persons/Commands/RegisterFace/RegisterFaceCommand.cs b/src/Heimdall.Application/Persons/Commands/RegisterFace/RegisterFaceCommand.cs index f8cd7fd..0984abb 100644 --- a/src/Heimdall.Application/Persons/Commands/RegisterFace/RegisterFaceCommand.cs +++ b/src/Heimdall.Application/Persons/Commands/RegisterFace/RegisterFaceCommand.cs @@ -32,7 +32,10 @@ public async Task> Handle(RegisterFaceCommand r var face = new KnownFace(request.PersonId, request.Embedding, request.ThumbnailUrl, request.SourceEventId); - // Add directly to DbContext to avoid EF Core change tracking confusion + // Add to person's navigation for in-memory consistency (tests, domain logic) + person.AddFace(face); + + // Also add directly to DbContext to avoid EF Core change tracking confusion // when adding to a collection navigation property _db.GetSet().Add(face);