title: Newtonsoft.Json: DeserializeObject(string value, Type type) returns JObject
body: <p>I'm using SignalR to receive a type name and Json, which for now I've relatively naively implemented by concatenating when with a pipe symbol on the server:</p>
  
  <pre><code>var ctx = GlobalHost.ConnectionManager.GetConnectionContext&lt;MyConnection&gt;();
  ctx.Connection.Broadcast(message.GetType().FullName + "|" + JsonConvert.SerializeObject(message));
  </code></pre>
  
  <p>On the client, I'm trying to deserialise back to the correct Type, but of course can't use any of the generic methods on <code>JsonConvert</code> so I came up with this:</p>
  
  <pre><code>var pipePos = eventMessageString.IndexOf("|", StringComparison.Ordinal);
  var typeName = eventMessageString.Substring(0, pipePos);
  var eventJson = eventMessageString.Substring(pipePos + 1);
  
  var eventType = Type.GetType(typeName);
  var evt = JsonConvert.DeserializeObject(eventJson, eventType);
  </code></pre>
  
  <p>The only trouble is that <code>evt</code> is a <code>Newtonsoft.Json.Linq.JObject</code>, when really it should be an instance of the <code>eventType</code> type.</p>
  
  <p>Is there a better way to do this, or at least a solution to get this working? I feel like I've missed something glaringly obvious - maybe I've been staring at it for too long?</p>
  
  <p>Many thanks in advance.</p>