コード例 #1
0
        public void Store(IEnumerable <Event> e)
        {
            foreach (var evt in e)
            {
                var source = evt.Source;

                var vnext =
                    _db.Any(source)
                        ? _db.GetVersion(source) + 1
                        : 0;

                var envelope = new EventEnvelope
                {
                    Zeit          = DateTime.Now,
                    Source        = source,
                    Event         = evt,
                    Inkrement     = _inkrement++,
                    SourceVersion = vnext
                };
                _db.Add(envelope);
            }
        }
コード例 #2
0
ファイル: EventStore.cs プロジェクト: Lazygeek1981/CqrsDemo
        public void Store(IEnumerable<Event> e)
        {
            foreach (var evt in e)
            {
                var source = evt.Source;

                var vnext =
                    _db.Any(source)
                        ? _db.GetVersion(source) + 1
                        : 0;

                var envelope = new EventEnvelope
                                   {
                                       Zeit=DateTime.Now,
                                       Source = source,
                                       Event = evt,
                                       Inkrement = _inkrement++,
                                       SourceVersion = vnext
                                   };
                _db.Add(envelope);
            }
        }
コード例 #3
0
 public void Add(EventEnvelope envelope)
 {
     _historie.Add(envelope);
 }
コード例 #4
0
 private LogLine CreateLogLine(EventEnvelope envelope)
 {
     return new LogLine {Lfd = envelope.Inkrement, Zeit = envelope.Zeit, Ereignis = envelope.Event.ToString(), Source=envelope.Source.ToString(), Version=envelope.SourceVersion};
 }
コード例 #5
0
 public void Add(EventEnvelope envelope)
 {
     _historie.Add(envelope);
 }