title: Parsing structured text input and composing structured output of nested classes
body: <p>Here is my code for reading from text file. It "works" and reads from the text file but there is a small bug. It returns this: <code>{Employee: Name: Name: red     ID: 123     ID:     Request: Name: Name: toilet     ID: 444     Desc: water     ID:     Desc: }</code> I know why its doing it, I just cant figure out how to fix it. <code>columns[0]</code> value  is "Name: red \t ID: 123" and <code>columnms[1]</code> value is "Name: toilet \t ID: 444 \t Desc: water".  </p>
  
  <p>I know it's doing it because I'm calling  <code>assignment.Employee.Name</code> but I don't know how else to call it to get it to show on my form. I thought it would be something like <code>assignment.Employee</code> but then it gives the error that I can't convert string to the Employee type. </p>
  
  <p>Assignment is a list that holds 2 objects from other lists (employee and service request).</p>
  
  <pre><code>public static List&lt;Assignment&gt; GetAssignment()
      {
          if (!Directory.Exists(dir))
              Directory.CreateDirectory(dir);
  
  
          StreamReader textIn =
              new StreamReader(
                  new FileStream(path3, FileMode.OpenOrCreate, FileAccess.Read));
  
          List&lt;Assignment&gt; assignments = new List&lt;Assignment&gt;();
  
          while (textIn.Peek() != -1)
          {
              string row = textIn.ReadLine();
              string[] columns = row.Split('|');
              if (columns.Length &gt;= 2)
              {
                  Assignment assignment = new Assignment();
  
                  assignment.Employee.Name = columns[0];
                  assignment.Request.Name = columns[1];
                  assignments.Add(assignment);
              }
          }
  
          textIn.Close();
  
          return assignments;
      }
  </code></pre>
  
  <p>EDIT: I expect it to just return <code>{Employee: Name: red   ID: 123     Request:  Name: toilet      ID: 444     Desc: water}</code></p>