NotificationLog CreateNotificationLog(NotificationLogInfo notificationLogInfo) { var storedEvents = this.eventStore.GetAllStoredEventsBetween(notificationLogInfo.NotificationLogId.Low, notificationLogInfo.NotificationLogId.High); var isArchived = notificationLogInfo.NotificationLogId.High > notificationLogInfo.TotalLogged; var next = isArchived ? notificationLogInfo.NotificationLogId.Next(NOTIFICATIONS_PER_LOG) : null; var previous = notificationLogInfo.NotificationLogId.Previous(NOTIFICATIONS_PER_LOG); return new NotificationLog( notificationLogInfo.NotificationLogId.Encoded, NotificationLogId.GetEncoded(next), NotificationLogId.GetEncoded(previous), GetNotificationsFrom(storedEvents), isArchived); }
NotificationLog CreateNotificationLog(NotificationLogInfo notificationLogInfo) { var storedEvents = this.eventStore.GetAllStoredEventsBetween(notificationLogInfo.NotificationLogId.Low, notificationLogInfo.NotificationLogId.High); var isArchived = notificationLogInfo.NotificationLogId.High > notificationLogInfo.TotalLogged; var next = isArchived ? notificationLogInfo.NotificationLogId.Next(NOTIFICATIONS_PER_LOG) : null; var previous = notificationLogInfo.NotificationLogId.Previous(NOTIFICATIONS_PER_LOG); return(new NotificationLog( notificationLogInfo.NotificationLogId.Encoded, NotificationLogId.GetEncoded(next), NotificationLogId.GetEncoded(previous), GetNotificationsFrom(storedEvents), isArchived)); }