public async Task SendChatMessage(string to, string message) { var userId = Context.User.Claims.First(c => c.Type == "userId").Value; await _messageService.AddOne(userId, to, message); await _conversationService.UpdateStatus(userId, to); await _unitOfWork.Commit(); await Clients.Groups(userId).SendAsync("sendChatMessage", message, userId); await Clients.Groups(to).SendAsync("sendChatMessage", message, userId); }