title: How to write a JSON file in C#?
body: <p>I need to write the following data into a text file using JSON format in C#. The brackets are important for it to be valid JSON format.</p>
  
  <pre><code>[
    {
      "Id": 1,
      "SSN": 123,
      "Message": "whatever"
  
    },
    {
     "Id": 2,
      "SSN": 125,
      "Message": "whatever"
    }
  ]
  </code></pre>
  
  <p>Here is my model class:</p>
  
  <pre><code>public class data
  {
      public int Id { get; set; }
      public int SSN { get; set; }
      public string Message { get; set;}
  }
  </code></pre>