Skip to content

Commit a07a88f

Browse files
Added DDD comment about the Address Id as "Shadow property" as a Value Object shouldn't have an ID in the domain model.
1 parent 6ca7f25 commit a07a88f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ void ConfigureAddress(EntityTypeBuilder<Address> addressConfiguration)
6262
{
6363
addressConfiguration.ToTable("address", DEFAULT_SCHEMA);
6464

65+
// DDD Pattern comment: Implementing the Address Id as "Shadow property"
66+
// becuase the Address is a Value-Object (VO) and an Id (Identity) is not desired for a VO
67+
// EF Core just needs the Id so it is capable to store it in a database table
68+
// See: https://docs.microsoft.com/en-us/ef/core/modeling/shadow-properties
6569
addressConfiguration.Property<int>("Id")
6670
.IsRequired();
6771

0 commit comments

Comments
 (0)