Append() публичный Метод

public Append ( IEnumerable events ) : void
events IEnumerable
Результат void
        public void Add(Guid aggregateId, IEnumerable<object> events)
        {
            var stream = new EventStream(aggregateId.ToString());
            stream.Append(events);
            _documentSession.Store(stream);

            SetRavenCollectionName(events, _documentSession, stream);

            _hasChanges = true;
        }
        public void Add(Guid aggregateId, IEnumerable <object> events)
        {
            var stream = new EventStream(aggregateId.ToString());

            stream.Append(events);
            _documentSession.Store(stream);

            SetRavenCollectionName(events, _documentSession, stream);

            _hasChanges = true;
        }
Пример #3
0
        public void Store(Guid aggregateId, IEnumerable<object> events)
        {
            using (var session = _documentStore.OpenSession())
            {
                var aggregateIdAsString = aggregateId.ToString();

                var stream = session.Load<EventStream>(aggregateIdAsString);

                if (stream == null)
                {
                    stream = new EventStream(aggregateIdAsString);
                    stream.Append(events);
                    session.Store(stream);
                }
                else
                {
                    stream.Append(events);
                }

                session.SaveChanges();
            }
        }
Пример #4
0
        public void Store(Guid aggregateId, IEnumerable <object> events)
        {
            using (var session = _documentStore.OpenSession())
            {
                var aggregateIdAsString = aggregateId.ToString();

                var stream = session.Load <EventStream>(aggregateIdAsString);

                if (stream == null)
                {
                    stream = new EventStream(aggregateIdAsString);
                    stream.Append(events);
                    session.Store(stream);
                }
                else
                {
                    stream.Append(events);
                }

                session.SaveChanges();
            }
        }