public static IEnumerable <Event> AsEvents(this IDomainEvent[] events) { var id = new EventId(); return(events.Select(domainEvent => { id = id.Increment(); return new Event { Notification = domainEvent, EventId = id }; }).ToList()); }