public async Task <IActionResult> AddExpertPredictions(int id, [FromBody] ExpertPredictionsWriteDto expertPredictions) { var nickname = expertPredictions.Nickname; var expertId = await _mediator.Send(new GetIdByNickname(nickname)); if (expertId == null) { return(NotFound()); } _tempData.AddPrediction(expertPredictions); var addExpertTourPredictions = new AddExpertTourPredictions(expertId.Value, id, expertPredictions.Predictions); var isCompletedSuccessfully = await _mediator.Send(addExpertTourPredictions); if (isCompletedSuccessfully) { return(Ok()); } else { return(new StatusCodeResult(StatusCodes.Status500InternalServerError)); } }