コード例 #1
0
        public void Apply(TestEvent1 domainEvent)
        {
            // these are for testing
            this.Value1 = domainEvent.Value1;
            this.Value2 = domainEvent.Value2;

            // this is for supporting snapshot
            this.InternalState.Value1 = domainEvent.Value1;
            this.InternalState.Value2 = domainEvent.Value2;
        }
コード例 #2
0
        private IEnumerable <KeyValuePair <string, JsonValue> > GetEventData(TestEvent1 domainEvent)
        {
            yield return(new KeyValuePair <string, JsonValue>("AggregateId", domainEvent.AggregateId.ToString()));

            yield return(new KeyValuePair <string, JsonValue>("Identity", domainEvent.Identity.ToString()));

            // not supported yield return new KeyValuePair<string, JsonValue>("Timestamp", domainEvent.Timestamp);
            yield return(new KeyValuePair <string, JsonValue>("Version", domainEvent.Version));

            yield return(new KeyValuePair <string, JsonValue>("Value1", domainEvent.Value1));

            yield return(new KeyValuePair <string, JsonValue>("Value2", domainEvent.Value2));
        }