예제 #1
0
            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));
                }
            }
예제 #2
0
 public static TestAggregateId GenerateTestAggregateId() => TestAggregateId.Of(Guid.NewGuid());
예제 #3
0
 private void Apply(TestAggregateCreated e)
 {
     SetIdentity(TestAggregateId.Of(Guid.Parse(e.AggregateId)));
 }