public async Task <IActionResult> Post([FromQuery] int id,
                                               [FromBody] string answer)
        {
            var userId = HttpContext.GetUserId();

            await _busPublisher.Send(new AddAnswer()
            {
                ExerciseId = id,
                UserId     = userId,
                UserAnswer = answer
            });

            return(Ok());
        }
        public async Task <IActionResult> Put(UppdateUserInformation request)
        {
            var id = HttpContext.GetUserId();

            var command = new UpdateUser()
            {
                Id         = id,
                Email      = request.Email,
                FirstName  = request.FirstName,
                LastName   = request.LastName,
                MiddleName = request.MiddleName,
                Phone      = request.Phone
            };
            await _busPublisher.Send(command);

            return(Ok());
        }
Esempio n. 3
0
        public async Task <IActionResult> Post(AddTournament tournament)
        {
            await _busPublisher.Send(tournament);

            return(Ok());
        }