title: Deserialize CSV with CustomHeaders using ServiceStack.Text
body: <p>I'm trying to use ServiceStack.Text for deserializing a csv file containing custom headers.</p>
  
  <pre><code>var csv = "Col-1,Col-2" + Environment.NewLine +
  "Val1,Val2" + Environment.NewLine +
  "Val3,Val3" + Environment.NewLine;
  
  public class Line
  {
      public string Col1 { get; set; }
      public string Col2 { get; set; }
  }
  
  ServiceStack.Text.CsvConfig&lt;Line&gt;.CustomHeadersMap = new Dictionary&lt;string, string&gt; {
      {"Col1", "Col-1"},
      {"Col2", "Col-2"}
  };
  
  var r2 = ServiceStack.Text.CsvSerializer.DeserializeFromString&lt;List&lt;Line&gt;&gt;(csv);
  
  Assert.That(r2.Count() == 2, "It should be 2 rows");
  Assert.That(r2[0].Col1 == "Val1", "Expected Val1");
  Assert.That(r2[0].Col2 == "Val2", "Expected Val2");
  </code></pre>
  
  <p>CustomHeadersMap is working when SerializeToString is used. But I can't get it working when using DeserializeFromString.</p>