title: Can you Instantiate an Object Instance from JSON in .NET?
body: <p>Since Object Initializers are very similar to JSON, and now there are Anonymous Types in .NET. It would be cool to be able to take a string, such as JSON, and create an Anonymous Object that represents the JSON string.</p>
  
  <p>Use Object Initializers to create an Anonymous Type:</p>
  
  <pre><code>var person = new {
      FirstName = "Chris",
      LastName = "Johnson"
  };
  </code></pre>
  
  <p>It would be awesome if you could pass in a string representation of the Object Initializer code (preferably something like JSON) to create an instance of an Anonymous Type with that data.</p>
  
  <p>I don't know if it's possible, since C# isn't dynamic, and the compiler actually converts the Object Initializer an<a href="http://www.developer.com/net/csharp/article.php/3589916" rel="noreferrer">d Anonymous Type into strongly typed code that can run. This is explained in</a> this article.</p>
  
  <p>Maybe functionality to take JSON and create a key/value Dictionary with it would work best.</p>
  
  <p>I know you can serialize/deserializer an object to JSON in .NET, but what I'm look for is a way to create an object that is essentially loosely typed, similarly to how JavaScript works.</p>
  
  <p>Does anyone know the best solution for doing this in .NET?</p>
  
  <p>UPDATE: Too clarify the context of why I'm asking this... I was thinking of how C# could better support JSON at the language level (possibly) and I was trying to think of ways that it could be done today, for conceptual reasons. So, I thought I'd post it here to start a discussion.</p>