title: C# MVC Convert Model into String Array
body: <p>I have a model which I populate from a fairly complex query. The model looks like:</p>
  
  <pre><code>public class CSVExportViewModel
  {
      public long Id { get; set; }
  
      public string StudentNo { get; set; }
      public string StudentIdNumber { get; set; }
      public string StudentName { get; set; }
      public string Parent1IdNumber { get; set; }
      public string Parent1Name { get; set; }
      public string Parent2IdNumber { get; set; }
      public string Parent2Name { get; set; }
      /* etc... */
  }
  </code></pre>
  
  <p>I now need to output the model to a CSV file using the code below:</p>
  
  <pre><code>List&lt;CSVExportViewModel&gt; data = GetData(dataset);
  
  foreach (CSVExportViewModel item in data)
  {
      writer.WriteLine("'" + string.Join("','", item) + "'");
  }
  </code></pre>
  
  <p>However, instead of converting the model into an array and outputting the individual items of the model, it just outputs "Models.CSVExportViewModel" to each line of the resulting CSV file.</p>
  
  <p>How can I convert the model into a String array to get this working properly?</p>