title: SignalR send message to specific user
body: <p>I created a SignalR project. Want an application like basic whatsapp. I can send message to all clients with SignalR, but I can't send message to a specific user. </p>
  
  <p>Here is what I tried.</p>
  
  <p><strong>Server side</strong></p>
  
  <pre><code>public class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          app.MapSignalR();
      }
  }
  
  public class ChatHub : Hub
  {
      public static string UserName = "";
      public void Send(string User, string Message)
      {
          //It doesn't works
          Clients.User(UserName).sendMessage(Message);
          //It works
          Clients.All.sendMessage(Message);
      }
      public override Task OnConnected()
      {
          //It works I get the UserName
          UserName = Context.QueryString["UserName"];
          return base.OnConnected();
      }
  }
  </code></pre>
  
  <p><strong>Client Side</strong></p>
  
  <pre><code>protected override async void OnAppearing()
  {
      chatHubConnection = new HubConnection("http://192.168.2.2:80/", new Dictionary&lt;string, string&gt;{
          { "UserName", myUser }
       });
      chatHubProxy = chatHubConnection.CreateHubProxy("ChatHub");
      chatHubProxy.On&lt;string&gt;("sendMessage", (k) =&gt; {
          Messages.Add(string.Format("Msg:{0}", k));
      });
      await chatHubConnection.Start();
  }
  private async void SendButton_Clicked(object sender, EventArgs e)
  {
      await chatHubProxy.Invoke&lt;string&gt;("Send", recieverEntry.Text, messageEntry.Text);
  }
  </code></pre>