Пример #1
0
        public async Task <CancelOrderResponse> CancelOrder(CancelOrderRequest request)
        {
            Domain.Order order = await repo.GetOrder(request.OrderId);

            order.Cancel();
            order = await repo.SaveAsync(order);

            return(new CancelOrderResponse(true, ResponseAction.Updated));
        }
        public async Task Consume(ConsumeContext <CancelOrderRequest> context)
        {
            var request = context.Message;

            Domain.Order order = await repo.GetOrder(request.OrderId);

            order.Cancel();
            order = await repo.SaveAsync(order);

            var response = new CancelOrderResponse(true, ResponseAction.Updated);

            await context.RespondAsync(response);
        }