JSON and XML to C# classes in Visual Studio

Although this feature is available for years in Visual Studio, I only recently discovered this gem that allows rapid generation of C# classes from either JSON or XML.

Here is how it works:

  1. Copy the JSON or XML code to the clipboard.
  2. In Visual Studio, go to Edit > Past Special and chose either Paste JSON as classes or Paste XML as classes.