Exemplo n.º 1
0
        public async Task <IActionResult> Post([FromBody] string value)
        {
            using (var transaction = await _sampleDbContext.Database.BeginTransactionAsync())
            {
                await _eventPublisher.PrepareAsync("test", value, new { signature = "" });

                transaction.Commit();
            }
            await _eventPublisher.ConfirmAsync();

            return(Ok());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Post([FromBody] string value)
        {
            var transaction = await _sampleDbContext.Database.BeginTransactionAsync();

            //await _eventPublisher.PrepareAsync("charge.ok.shuttle", "Hello-World1", new { signature = "" });
            //await _eventPublisher.PrepareAsync("charge.ok.commute", "Hello-World2", new { signature = "" });

            for (var i = 0; i < 5; ++i)
            {
                await _eventPublisher.PrepareAsync("charge.ok.shuttle", "Hello-World1", new { signature = "" });
            }

            transaction.Commit();

            await _eventPublisher.ConfirmAsync();

            return(Ok());
        }