public void SendNotification(string username) { var msg = string.Empty; if (username == webHelper.GetUserName()) { msg = "You cannot sent invitation to yourself!"; } else { var isSucces = this.invitationService.AddInvitation(username, webHelper.GetHouseholdIdFromCookie()); if (isSucces) { Clients.User(username).addNotification(); msg = "Invitation was sent."; } else { msg = "Invitation was previously sent or user is already in this household!"; } } var connId = Context.ConnectionId; Clients.Client(connId).addMessage(msg); }