public async Task <IActionResult> PatchMessageAsync(int messageId) { int userId = int.Parse(User.Identity.Name); if (!await messagesRepository.IsMessageUserAsync(messageId, userId)) { return(BadRequest()); } await messagesRepository.CloseMessageAsync(messageId, userId); return(Ok()); }