public async Task <ActionResult <ICollection <GetMessageDto> > > GetMessagesForChat(int ChatId, [FromQuery] PaginationFilterDto pagination) { try { var userId = this.User.Claims.First(c => c.Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier").Value; return(Ok(await _messagesService.GetAllMessagesForChat(ChatId, userId, pagination))); } catch (Exception ex) { _logger.Error(ex); return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }