public Task Update(IContainSagaData sagaData, SynchronizedStorageSession session, ContextBag context) { var operations = new SagaPersisterAtomicOperations(session); var versionInfo = operations.GetSagaVersion(sagaData.Id); var dataStream = versionInfo.StreamName; var stateChangeEvent = new EventData(Guid.NewGuid(), SagaDataEventType, true, sagaData.ToJsonBytes(), new byte[0]); if (session.SupportsOutbox()) { return(session.AppendViaOutbox(dataStream, versionInfo.Version, stateChangeEvent)); } return(session.AppendToStreamAsync(dataStream, versionInfo.Version, stateChangeEvent)); }