title: Order of the items in returned List from File.ReadAll()
body: <p>I am not too sure of what the answer to this is so I would appreciate information to help me better understand what I have here. My goal is to read the contents of a text file into a list, parse the information and remove orphan records(child records/line that do not have associated parent records/line before it in the file) and then write the remaining lines back to the file in order. </p>
  
  <p>I use the following approach</p>
  
  <pre><code>IList&lt;String&gt; lines  = File.ReadAll(Filepath);
  IList&lt;String&gt; secondlines = lines.Copy();
  
  foreach (String line in lines) 
  {
      If Brecord 
          foreach String record in secondlines 
          {
               if  record is same as Brecord 
                     //No Parent record found for this Brecord before it
                      Delete record 
                else if record is Parent of Brecord 
                       exit loop
           }
  }
  
  
  File.WriteAll(secondlines , SecondPath)
  </code></pre>
  
  <p>How can I make sure that everytime this happens, the contents of the file are handled in the order they appear in the file please? </p>