public async Task <IActionResult> GetById(int id) { try { var userIdClaim = ((ClaimsIdentity)User.Identity).FindFirst(ClaimTypes.NameIdentifier); var userId = int.Parse(userIdClaim.Value); await _messagesRepository.Read(id, userId); return(Ok(await _requestsRepository.GetById(id))); } catch (InvalidRequestException) { return(NotFound()); } }