title: Deserialize JSON into an Object(s) using System.Text.Json
body: <p>I am trying to use the <code>System.Text.Json.Serialization</code> namespace to deserialize the text within a JSON file into an Object named Note, to then access its properties. With the later intent to read-in multiple Note objects, to then store in a List for example.</p>
  
  <p>There don't seem to be many examples on the usage of this namespace, other than within the DOTNET docs <a href="https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-how-to</a></p>
  
  <p>This is my attempt based on the examples given. Which throws the error shown below, if you know what I'm doing wrong please let me know, thanks.</p>
  
  <pre><code>class Note
  {
      public DateTime currentDate { get; set; }
      public string summary { get; set; }
      public Note(DateTime _date, string _sum)
      {
          currentDate = _date;
          summary = _sum;
      }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          //Write json data
          string path = @"D:\Documents\Projects\Visual Projects\Notes Data\ThingsDone.json";
  
          DateTime date = DateTime.Now;
          string givenNote = "summary text";
  
          Note completeNote = new Note(date, givenNote);
  
          string serialString = JsonSerializer.Serialize(completeNote);
          File.WriteAllText(path, serialString);
  
          //Read json data
          string jsonString = File.ReadAllText(path);
          Note results = JsonSerializer.Deserialize&lt;Note&gt;(jsonString);
          Console.WriteLine(results.summary);
      }
  }
  </code></pre>
  
  <p>Also I've looked into Json.NET and other options, but I would rather use this one (if possible)</p>