Example #1
0
        public async Task <IActionResult> Buy([FromBody] BuyEventTicketViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                NotifyModelStateErrors();
                return(Response(viewModel));
            }

            viewModel.UserId = _user.Id;

            await _userSchoolingEventTicketService.BuyTicket(viewModel);

            return(Response(new {}));
        }
        public async Task BuyTicket(BuyEventTicketViewModel viewModel)
        {
            var command = Mapper.Map <BuyEventTicketCommand>(viewModel);

            await _bus.SendCommand(command);
        }