From c1f89e65ae8794dce4fd2897cee7f5bd0e8d1c62 Mon Sep 17 00:00:00 2001 From: Carl Sixsmith Date: Thu, 27 Jun 2024 08:44:09 +0100 Subject: [PATCH] The id was not being generated when following the new static factory method. This led to a database exception. --- src/Domain/Entities/Documents/Document.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Domain/Entities/Documents/Document.cs b/src/Domain/Entities/Documents/Document.cs index 95c948e3..57de748a 100644 --- a/src/Domain/Entities/Documents/Document.cs +++ b/src/Domain/Entities/Documents/Document.cs @@ -7,13 +7,15 @@ namespace Cfo.Cats.Domain.Entities.Documents; public class Document : OwnerPropertyEntity, IMayHaveTenant, IAuditTrial { + private Document() { - Id = Guid.NewGuid(); + } private Document(string title, string description, DocumentType documentType) { + Id = Guid.NewGuid(); Title = title; IsPublic = false; Description = description;