Browse Source

Added DDD comment about the Address Id as "Shadow property" as a Value Object shouldn't have an ID in the domain model.

pull/173/head
Cesar De la Torre 7 years ago
parent
commit
a07a88f9c4
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs

+ 4
- 0
src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs View File

@ -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<int>("Id")
.IsRequired();


Loading…
Cancel
Save