title: Able to deserialize string type but not object type
body: <p>I am using C# with JSON.NET. Below are the two types.</p>
  
  <pre><code>   JSON object -  var user = { "name": "test", "title": "mytitle"};
     JSON String -  var user1 = "{ \"name\": \"test\", \"title\": \"mytitle\" }";     
  </code></pre>
  
  <p>Using Newtonsoft.Json to deserialize the JSON object. C# Code in which I am handling JSON.</p>
  
  <pre><code>      public class sampledata
        {
          [JsonProperty("name")]
          public string name { get; set; }
  
           [JsonProperty("title")]
          public string title { get; set; }
        }
       public void SampleEvent(string param)
          {
  
              sampledata s = JsonConvert.DeserializeObject&lt;sampledata&gt;(param);
           }
  </code></pre>
  
  <p><strong>When I got JSON String in param the deserialization is fine.</strong> But when I got JSON object in param - First error I am getting is </p>
  
  <blockquote>
    <blockquote>
      <p>"Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'UCRS.MainWindow+sampledata' because the type requires a JSON object
      (e.g. {"name":"value"}) to deserialize correctly.</p>
    </blockquote>
    
    <p>To fix this error either change the JSON to a JSON object (e.g.
    {"name":"value"}) or change the deserialized type to an array or a
    type that implements a collection interface (e.g. ICollection, IList)
    like List that can be deserialized from a JSON array.
    JsonArrayAttribute can also be added to the type to force it to
    deserialize from a JSON array.</p>
    
    <p>Path '', line 1, position 1.</p>
  </blockquote>
  
  <p>So I changed the code as :</p>
  
  <pre><code>      List&lt;sampledata&gt; s = JsonConvert.DeserializeObject&lt;List&lt;sampledata&gt;&gt;(param);
  </code></pre>
  
  <p>Then I am facing different issue </p>
  
  <blockquote>
    <p>" Unexpected character encountered while parsing value: o. Path '',
    line 1, position 1."</p>
  </blockquote>
  
  <p>When some event is raised in web page I am handling that event in c# using webbrowser objectforscripting. I always get the JSON object as param. How to deserialize JSON object in C#? Please help</p>