From a07a88f9c4a2c997432ebafe24f05110cc03a793 Mon Sep 17 00:00:00 2001 From: Cesar De la Torre Date: Thu, 6 Apr 2017 11:47:10 -0700 Subject: [PATCH] Added DDD comment about the Address Id as "Shadow property" as a Value Object shouldn't have an ID in the domain model. --- .../Ordering/Ordering.Infrastructure/OrderingContext.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs index 843cac3b6..70bb8a51a 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs @@ -62,6 +62,10 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure { addressConfiguration.ToTable("address", DEFAULT_SCHEMA); + // DDD Pattern comment: Implementing the Address Id as "Shadow property" + // becuase the Address is a Value-Object (VO) and an Id (Identity) is not desired for a VO + // EF Core just needs the Id so it is capable to store it in a database table + // See: https://docs.microsoft.com/en-us/ef/core/modeling/shadow-properties addressConfiguration.Property("Id") .IsRequired();