Esempio n. 1
0
        static Task InitiateJob(SagaConsumeContext <BatchState> context)
        {
            var orderId    = context.Saga.UnprocessedOrderIds.Pop();
            var batchJobId = NewId.NextGuid();

            context.Saga.ProcessingOrderIds.Add(batchJobId, orderId);
            return(context.Publish <BatchJobReceived>(new
            {
                BatchJobId = batchJobId,
                InVar.Timestamp,
                BatchId = context.Saga.CorrelationId,
                OrderId = orderId,
                context.Saga.Action
            }));
        }