Update CsvHelper from 2.14 to 12.2.1

This commit is contained in:
2019-11-20 21:45:44 -05:00
parent 5dabdb3039
commit aa14c362f7
6 changed files with 46 additions and 36 deletions
+10 -11
View File
@@ -20,10 +20,10 @@ namespace LeafWeb.Core.Parsers
{
var fittingTitles = GetNextCsvRowValues();
if (fittingTitles == null)
throw new ParseException($"Could not read data header row on line number {CsvReader.Row}");
throw new ParseException($"Could not read data header row on line number {CsvReader.Context.Row}");
var fitUnits = GetNextCsvRowValues();
if (fitUnits == null)
throw new ParseException($"Could not read data units row on line number {CsvReader.Row}");
throw new ParseException($"Could not read data units row on line number {CsvReader.Context.Row}");
return ParseLeafGasComparisonSet(fittingTitles, matchCurveId).ToArray();
}
@@ -32,10 +32,10 @@ namespace LeafWeb.Core.Parsers
{
var fittingTitles = GetNextCsvRowValues();
if (fittingTitles == null)
throw new ParseException($"Could not read data header row on line number {CsvReader.Row}");
throw new ParseException($"Could not read data header row on line number {CsvReader.Context.Row}");
var fitUnits = GetNextCsvRowValues();
if (fitUnits == null)
throw new ParseException($"Could not read data units row on line number {CsvReader.Row}");
throw new ParseException($"Could not read data units row on line number {CsvReader.Context.Row}");
return ExtractSectionCurveIds(fittingTitles).Distinct().ToArray();
}
@@ -53,7 +53,7 @@ namespace LeafWeb.Core.Parsers
.Create(fittingTitles, new[] {values});
yield return fittingInfo[0].CurveID;
while (!CsvReader.IsRecordEmpty())
while (CsvReader.Context.Record.Length != 0)
values = GetNextCsvRowValues();
} while (values != null);
}
@@ -71,12 +71,11 @@ namespace LeafWeb.Core.Parsers
while (true)
{
var values = GetNextCsvRowValues();
if (CsvReader.IsRecordEmpty())
if (values == null) // end of file
yield break;
if (string.IsNullOrEmpty(CsvReader.Context.RawRecord))
continue;
//throw new ParseException($"Encountered empty line while reading fitting info on line {CsvReader.Row}");
if (values == null) // end of file
yield break;
if (matcher.IsPropertiesTitlesMatch(values))
if (matcher.IsPropertiesTitlesMatch(values))
{
photosyntheticTitles = values;
break;
@@ -97,7 +96,7 @@ namespace LeafWeb.Core.Parsers
while (true)
{
var values = GetNextCsvRowValues();
if (CsvReader.IsRecordEmpty()) // end of set
if (CsvReader.Context.Record.Length == 0) // end of set
break;
if (values == null)
{