public async Task <TResult> ExecuteTransaction <TResult>(string requestId, TPartition partitionKey, Func <IHumanInterfaceConnectorMessageSession, Task <TResult> > transaction)
        {
            var transactionRecordContainer = applicationStateStore.Create(partitionKey);

            var outcome = await processor.Process(requestId, transactionRecordContainer, null, async (ctx, transactionContext) =>
            {
                var session = new HumanInterfaceConnectorMessageSession(requestId, transactionContext, rootMessageSession, messageStore);
                var result  = await transaction(session).ConfigureAwait(false);
                await transactionInProgressStore.BeginTransaction(requestId, transactionRecordContainer.UniqueIdentifier).ConfigureAwait(false);
                return(ProcessingResult <TResult> .Successful(result));
            });

            return(outcome.Value); //Duplicate check is ignored in the human interface
        }
Beispiel #2
0
 public Task BeginTransaction(string transactionId, string partitionKey)
 {
     return(impl.BeginTransaction(transactionId, partitionKey));
 }