示例#1
0
        public async Task <CompleteOrderResponse> CompleteOrder(CompleteOrderRequest request)
        {
            Domain.Order order = await repo.GetOrder(request.OrderId);

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

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

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

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

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

            await context.RespondAsync(response);
        }