Пример #1
0
 internal static EventData GetScheduledEventData(this EventStoreContext context, TimelinePoint cause, DateTimeOffset now) =>
 context.GetAreaEventData(
     cause.Event,
     cause.Position,
     now,
     null,
     true,
     Id.FromGuid(),
     cause.CommandId,
     cause.UserId,
     null,
     cause.Type.GetRoutes(cause.Event).ToMany());
Пример #2
0
        public Task WriteScheduledEvent(TimelinePoint cause)
        {
            var e = cause.Event;

            var data = _context.GetAreaEventData(
                e,
                cause.Position,
                Clock.Now,
                null,
                Id.FromGuid(),
                cause.CommandId,
                cause.UserId,
                null,
                cause.Type.GetRoutes(e, scheduled: false).ToMany());

            return(_context.Connection.AppendToStreamAsync(TimelineStreams.Timeline, ExpectedVersion.Any, data));
        }
        internal static IEnumerable <EventData> GetNewEventData(
            this EventStoreContext context,
            TimelinePosition cause,
            FlowKey topic,
            Many <Event> newEvents) =>

        from e in newEvents
        select context.GetAreaEventData(
            e,
            cause,
            e.When,
            Event.Traits.WhenOccurs.Get(e),
            Event.Traits.EventId.Get(e),
            Event.Traits.CommandId.Get(e),
            Event.Traits.UserId.Get(e),
            topic,
            context.GetEventType(e).GetRoutes(e).ToMany());