How can I deserialize a json file back into the generic list from which it was Serialized?
<p>I am using JSON.NET to serialize a generic list to a json file. It's working fine, but I don't know how to reverse the process - read in the json file and inflate the generic list with its contents.</p>

<p>I have a very simple class:</p>

<pre><code>public class AssignmentTypesLU
{
    public int AssignmentID { get; set; }
    public string AssignmentName { get; set; }
}
</code></pre>

<p>...and a generic list to hold instances of it:</p>

<pre><code>List&lt;AssignmentTypesLU&gt; assignmentTypesList;
</code></pre>

<p>I then populate the generic list if the file does not already exist (theoretically, the condition is only true once):</p>

<pre><code>if (!System.IO.File.Exists(ASSIGNMENT_TYPES_FILENAME))
{
    List&lt;AssignmentTypesLU&gt; atluList = new List&lt;AssignmentTypesLU&gt;();
    AssignmentTypesLU atlu = new AssignmentTypesLU();
    atlu.AssignmentID = 1;
    atlu.AssignmentName = "Bible Reading";
    atluList.Add(atlu);

    atlu = new AssignmentTypesLU();
    atlu.AssignmentID = 2;
    atlu.AssignmentName = "Initial Call";
    atluList.Add(atlu);

    . . .

    // Serialize contents of list to json file
    var jsonAssignmentTypesLU = JsonConvert.SerializeObject(atluList);
    System.IO.File.WriteAllText(ASSIGNMENT_TYPES_FILENAME, jsonAssignmentTypesLU);
}
</code></pre>

<p>But I then want to open the json file and read the contents back into the generic list. The only thing I've got so far is:</p>

<pre><code>// Now open these files and read their contents into the lists declared above.
if (System.IO.File.Exists(ASSIGNMENT_TYPES_FILENAME))
{
    var jsonContents = System.IO.File.ReadLines(ASSIGNMENT_TYPES_FILENAME);
    assignmentTypesList = JsonConvert.DeserializeObject&lt;List&lt;AssignmentTypesLU&gt;&gt;(jsonContents);
}
</code></pre>

<p>...but with that (admittedly kind of a wild guess) I get, "<em>cannot convert from 'System.Collections.Generic.IEnumerable' to 'string'</em>"</p>

<p>What is the correct way to accomplish this?</p>