protected override void When(IDomainEvent domainEvent) { switch (domainEvent) { case TestAggregateCreated testAggregateCreated: SetIdentity(TestAggregateId.Of(Guid.Parse(testAggregateCreated.AggregateId))); break; case TransformationDone transformationDone: Value = transformationDone.Value; break; default: throw new ArgumentOutOfRangeException(nameof(domainEvent)); } }
public static TestAggregateId GenerateTestAggregateId() => TestAggregateId.Of(Guid.NewGuid());
private void Apply(TestAggregateCreated e) { SetIdentity(TestAggregateId.Of(Guid.Parse(e.AggregateId))); }