title: How to use generic hub in SignalR
body: <p>I am using SignalR in version 2.1.2. I have noticed there are two public hub classes for me to use, <a href="http://msdn.microsoft.com/en-us/library/microsoft.aspnet.signalr.hub.aspx" rel="noreferrer"><code>Hub</code></a> and <code>Hub&lt;T&gt;</code>. The former has an MSDN page which appears to be outdated and the latter lacks any MSDN page at all. I believe the MSDN documentation is not up to date with the latest version of SignalR from Nuget (which I'm using), because sources decompiled with the help of ReSharper show both of the classes inherit from <code>HubBase</code> base class. The MSDN page's Inheritance Hierarchy section shows the <code>Hub</code> class as inheriting from <code>Object</code> and implementing <code>IHub</code> and <code>IDisposable</code> interfaces, however the decompiled sources reveal the aforementioned <code>HubBase</code> base class, implementing the <code>IHub</code> interface which in turn implements <code>IDisposable</code>.</p>
  
  <p>The difference between the non-generic and generic variant of the classes is that the non-generic one's <code>Clients</code> property returns <code>IHubCallerConnectionContext&lt;dynamic&gt;</code> while the generic variant returns typed <code>IHubCallerConnectionContext&lt;T&gt;</code>.</p>
  
  <p>I'd like to have my clients typed, so when I call the client methods from the hub, I'd have proper Intellisense support and strongly-typed arguments. What I struggle with, though, is how to let the Hub know that my client model's method is actually to be invoked in the browser.</p>
  
  <p>This is my <code>TestModel</code> class:</p>
  
  <pre><code>public sealed class TestModel
  {
     public String Name { get; set; }
     public void Notify() {}
     public void NotifyComplex(TestModel model) {}
  }
  </code></pre>
  
  <p>With the non-generic hub, I'd just call <code>.Notify()</code> or <code>.Notify(new TestModel() { Name = "sth" })</code> on the <code>dynamic</code>ly bound <code>this.Context.Clients.Client(…)</code> or <code>this.Context.Caller</code>, but with the generic class, when I call these empty methods in similar manner, the browser is not notified at all.</p>
  
  <p>How do you use the generic hub class the way it's supposed to be used?</p>