title: serialize json to object c#
body: <p>I am new to json,I am trying to convert json response to object</p>
  
  <p>the json is</p>
  
  <pre><code>"[{\"fields\":[[\"name\",\"value\",\"values\",\"error\"],[\"username\",\"test\",null,\"\"],[\"password\",\"test\",null,\"\"],[\"accountid\",\"\",null,\"\"],[\"rememberMe\",\"Y\",null,\"\"],[\"language\",\"en-US\",null,\"\"],[\"S\",\"test\",null,null]],\"success\":\"Y\",\"message\":\"User authenticated. Logging in.\"}]"
  </code></pre>
  
  <p>I wrote two classes</p>
  
  <pre><code>  public class fields
      {
        public string name { get; set; }
        public string value { get; set; }
        public string values { get; set; }
        public string error { get; set; }
      }
  
      public class Demo
      {
          public List&lt;fields&gt; fields { get; set; }
          public string message { get; set; }
          public string success { get; set; }
  
      }
  </code></pre>
  
  <p>I made this Serialize code:</p>
  
  <pre><code>JsonSerializer serializer = new JsonSerializer();
      Demo result = JsonConvert.DeserializeObject&lt;Demo&gt;(responseFromServer);
  
  or this
  
    Demo result = new JavaScriptSerializer().Deserialize&lt;Demo&gt;(responseFromServer);
  </code></pre>
  
  <p>the error is</p>
  
  <pre><code>Type '_Default+fields' is not supported for deserialization of an array
  </code></pre>
  
  <p>Thanks</p>
  
  <p>Baaroz</p>