Ejemplo n.º 1
0
        public async Task <SagaResult> GetResult()
        {
            await eventSender.SagaStarted(Id, poleSagasOption.ServiceName, DateTime.UtcNow);

            var executeActivity = GetNextExecuteActivity();

            if (executeActivity == null)
            {
                var expiresAt = DateTime.UtcNow.AddSeconds(poleSagasOption.CompeletedSagaExpiredAfterSeconds);
                await eventSender.SagaEnded(Id, expiresAt);

                return(SagaResult.SuccessResult);
            }
            var result = await RecursiveExecuteActivity(executeActivity);

            return(result);
        }