private void ProcessRowInsert(DateTime?currentTableDate, string line, List <LegacyDataItem> recordsForDay) { if (currentTableDate.HasValue) { LegacyDataItem readItem = TryGetRow(line, currentTableDate.Value); if (readItem != null) { recordsForDay.Add(readItem); } } }
private LegacyDataItem TryGetRow(string line, DateTime date) { try { var parts = SplitLineForDataRow(line); var result = new LegacyDataItem(); result.Id = long.Parse(parts[0].Trim()); result.Name = parts[1].Trim(); result.Token = parts[2].Trim(); result.Address = parts[3].Trim(); result.TotalPoints = long.Parse(parts[4].Trim()); result.Date = date; return(result); } catch (Exception) { loggingService.LogWarning($"Row could not be parsed: {line}"); return(null); } }