public async Task <IActionResult> Send([FromBody] SendFriendshipRequestDto friendshipRequestDto) { friendshipRequestDto.From = await GetAuthenticatedUserAccount(); var result = await _socialService.SendFriendshipRequest(friendshipRequestDto); if (result.Failed) { return(BadRequest(new ValidationErrorResponse(result.Error))); } await _hubContext.Clients .User(result.Data.ToId.ToString()) .SendAsync( FriendshipHub.FriendshipRequestReceivedMessage, FriendshipRequestViewModel.FromEntity(result.Data) ); return(Ok()); }