public Task <OrderSagaData> FindBy(StartOrder message, SynchronizedStorageSession storageSession, ReadOnlyContextBag context) { IAsyncDocumentSession session = storageSession.RavenSession(); //if the instance is null a new saga will be automatically created if //the Saga handles the message as IAmStartedByMessages<StartOrder>; otherwise an exception is raised. return(session.LoadByUniqueConstraintAsync <OrderSagaData>(d => d.OrderId, message.OrderId)); }
public Task <OrderSagaData> FindBy(PaymentTransactionCompleted message, SynchronizedStorageSession storageSession, ReadOnlyContextBag context) { IAsyncDocumentSession session = storageSession.RavenSession(); return(session.LoadByUniqueConstraintAsync <OrderSagaData>(d => d.PaymentTransactionId, message.PaymentTransactionId)); }
public Task <OrderSagaData> FindBy(CompleteOrder message, SynchronizedStorageSession storageSession, ReadOnlyContextBag context) { IAsyncDocumentSession session = storageSession.Session(); return(session.LoadByUniqueConstraintAsync <OrderSagaData>(d => d.OrderId, message.OrderId)); }