diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/BindingContract.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/BindingContract.cs index 28755792..c4defd8b 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/BindingContract.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/BindingContract.cs @@ -16,7 +16,7 @@ public sealed class BindingContract : Entity public DateTimeOffset TerminatedAt { get; set; } public DateTimeOffset BindingFrom { get; init; } public DateTimeOffset ExpiringAt { get; init; } - public ICollection RegisteredAnnexes { get; } + public ICollection AttachedAnnexes { get; } private BindingContract( ContractId contractId, @@ -31,7 +31,7 @@ private BindingContract( Duration = duration; ExpiringAt = expiringAt; BindingFrom = bindingFrom; - RegisteredAnnexes = []; + AttachedAnnexes = []; var @event = BindingContractStartedEvent.Raise(BindingFrom, ExpiringAt); RecordEvent(@event); @@ -49,7 +49,7 @@ public void AttachAnnex(DateTimeOffset validFrom, DateTimeOffset now) BusinessRuleValidator.Validate( new AnnexCanOnlyBeAddedOnlyBeAddedToActiveBindingContractRule(TerminatedAt, ExpiringAt, now)); - RegisteredAnnexes.Add(Annex.Attach(Id, validFrom)); + AttachedAnnexes.Add(Annex.Attach(Id, validFrom)); } public void Terminate(DateTimeOffset terminatedAt) diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Configurations/BindingContractEntityConfiguration.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Configurations/BindingContractEntityConfiguration.cs index 7c36ba3f..a849c704 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Configurations/BindingContractEntityConfiguration.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Configurations/BindingContractEntityConfiguration.cs @@ -28,7 +28,7 @@ public void Configure(EntityTypeBuilder builder) builder.Property(contract => contract.BindingFrom).IsRequired(); builder.Property(contract => contract.ExpiringAt).IsRequired(); - builder.OwnsMany(nameof(BindingContract.RegisteredAnnexes), annex => + builder.OwnsMany(nameof(BindingContract.AttachedAnnexes), annex => { annex.WithOwner().HasForeignKey(a => a.BindingContractId); annex.ToTable("Annexes"); diff --git a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240412114229_AddAnnexes.Designer.cs b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240412114229_AddAnnexes.Designer.cs index 1ed67071..973e36f9 100644 --- a/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240412114229_AddAnnexes.Designer.cs +++ b/Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Infrastructure/Database/Migrations/20240412114229_AddAnnexes.Designer.cs @@ -83,7 +83,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("EvolutionaryArchitecture.Fitnet.Contracts.Core.BindingContract", b => { - b.OwnsMany("EvolutionaryArchitecture.Fitnet.Contracts.Core.Annex", "RegisteredAnnexes", b1 => + b.OwnsMany("EvolutionaryArchitecture.Fitnet.Contracts.Core.Annex", "AttachedAnnexes", b1 => { b1.Property("BindingContractId") .HasColumnType("uuid"); @@ -102,7 +102,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasForeignKey("BindingContractId"); }); - b.Navigation("RegisteredAnnexes"); + b.Navigation("AttachedAnnexes"); }); #pragma warning restore 612, 618 }