public void UpdateName(EntityTestId aggregateId, Name name) { if (name.ValidationStatus.IsValid && !AggregateId.Equals(aggregateId)) { Apply(TestEntityAggregateUpdatedDomainEvent.From(AggregateId, name, Version)); } AppendValidationResult(name.ValidationStatus.Failures); }
public bool Equals(EventReader other) { if (other is null) { return(false); } return(AggregateId.Equals(other.AggregateId) && MajorVersion == other.MajorVersion && MinorVersion == other.MinorVersion); }
public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } var other = (Event)obj; return(AggregateId.Equals(other.AggregateId) && ProcessId.Equals(other.ProcessId)); }
public override bool Equals(object obj) { var compareTo = obj as AggregateRoot; if (ReferenceEquals(this, compareTo)) { return(true); } if (ReferenceEquals(null, compareTo)) { return(false); } return(AggregateId.Equals(compareTo.AggregateId)); }
public override bool Equals(object obj) { if (this == obj) { return(true); } var item = obj as CourseCreatedDomainEvent; if (item == null) { return(false); } return(AggregateId.Equals(item.AggregateId) && Name.Equals(item.Name) && Duration.Equals(item.Duration)); }
/// <summary> /// Creates a new domain event stream which has the appended domain event stream. /// </summary> /// <param name="streamToAppend">Domain event stream to append to this domain event stream.</param> /// <returns>New instance of domain event stream with the appended domain event stream.</returns> public DomainEventStream <TAggregateId> AppendDomainEventStream(IDomainEventStream <TAggregateId> streamToAppend) { if (streamToAppend == null) { throw new ArgumentNullException(nameof(streamToAppend)); } if (!AggregateId.Equals(streamToAppend.AggregateId)) { throw new InvalidOperationException("Cannot append domain event belonging to a different aggregate."); } if (EndVersion >= streamToAppend.BeginVersion) { throw new DomainEventVersionConflictException("Domain event streams contain some entries with overlapping versions."); } return(new DomainEventStream <TAggregateId>(AggregateId, this.Concat(streamToAppend))); }
protected bool Equals(EventStreamChange other) { return(AggregateId.Equals(other.AggregateId)); }