This project has moved. For the latest updates, please go here.

Create WithColumnHeaders(this IEnumerable<string[]>) Extension Method


To add support for Split*Rows functionality where the first row is a set of column headers, create the following extension methods:
  1. WithColumnHeaders(this IEnumerable<string[]>, string[] expectedColumnNames = null, bool enforceExpectedColumnNamesOrder = false)
    This extension method will create a StringRowWrapperFactory using the first row and then Wrap subsequent rows and return StringRowWrappers.  ExpectedColumnNames should be verified using IEnumerable<string>.SequenceEqual, and ordering of column names should be enforced (throw an exception) depending on the value of the enforcement parameter.
    Furthermore, a meaningful exception should be passed for any wrapping failures (include the rowNumber/Index).