title: Deserializing a simple JSON array with DataContractJsonSerializer
body: <p>I'm sure this question has been asked over and over again, but for some reason, I still can't manage to get this to work.</p>
  
  <p>I want to deserialize a JSON object that contains a single member; a string array:</p>
  
  <pre><code>{"results" : ["a", "b"]}
  </code></pre>
  
  <p>This is the class that I'm trying to deserialize into:</p>
  
  <pre><code>public class Whatever {
      [DataMember(Name = "results")]
      public string[] Results { get; protected set; }
  }
  </code></pre>
  
  <p>And this is the Deserialize method:</p>
  
  <pre><code>private static T Deserialize&lt;T&gt;(string json)
  {
      var instance = Activator.CreateInstance&lt;T&gt;();
      using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(json)))
      {
          var serializer = new DataContractJsonSerializer(instance.GetType());
          return (T)serializer.ReadObject(ms);
      }
  }
  </code></pre>
  
  <p>A call like <code>Deserialize&lt;Whatever&gt;("{\"results\" : [\"a\", \"b\"]}")</code> is returning an initialized instance of <code>Whatever</code> but the <code>Results</code> array is staying <code>null</code>.</p>
  
  <p>Is there something wrong with the structure of <code>Whatever</code>?</p>