title: Is there a way in signalr to remove a user from a list when that user disconnects?
body: <p>I am making a little chat app with signalr, and when users click on Join the server adds that user to the <code>ConnectedUsers</code> list.</p>
  
  <p>But how am i supposed to remove a specific user from the list and notify the other clients that the user disconnected?</p>
  
  <p><strong>ChatHub.cs</strong></p>
  
  <pre><code>static List&lt;User&gt; ConnectedUsers = new List&lt;User&gt;();
  
  public async Task Join(string name) {
  
              var id = Context.ConnectionId;
              ConnectedUsers.Add(new User {ID = id, Name = name});
              await Clients.Caller.SendAsync("update", "You have connected to the server.");
              await Clients.Others.SendAsync("update", name + " has joined the server.");
              await Clients.All.SendAsync("update-people", JsonConvert.SerializeObject(ConnectedUsers));
          }
  
  public override async Task OnDisconnectedAsync(Exception exception)
          {
              var _user = ConnectedUsers[Convert.ToInt32(Context.ConnectionId)];
              await Clients.All.SendAsync("test", _user);
              //ConnectedUsers.Remove();
              return base.OnDisconnectedAsync(exception);
          }
  </code></pre>
  
  <p><strong>User.cs</strong></p>
  
  <pre><code>public class User
      {
          public string ID { get; set; }
          public string Name { get; set; }
      }
  </code></pre>
  
  <p>I expect that the user gets removed from the ConnectedUsers list and notify the other clients about the user disconnecting, but I can't use a await SendAsync in the override for OnDisconnectedAsync.</p>