ErrorDuringMassImportArgs
Error record before mass import occurs.
These tend to be issues with the data source itself.
using System.Collections.Generic;
namespace Relativity.DataExchange.Io
{
public class ErrorDuringMassImportArgs : IErrorArguments
{
private readonly string lineNumber;
private readonly string message;
private readonly string identifier;
private readonly string type;
public ErrorDuringMassImportArgs(string lineNumber, string message, string identifier, string type)
{
this.lineNumber = lineNumber;
this.message = message;
this.identifier = identifier;
this.type = type;
}
public string FormattedLineInFile()
{
return ValuesForErrorFile().ToCsv(CSVFormat);
}
private static string CSVFormat(string fieldValue)
{
string text = '"'.ToString();
string newValue = text + text;
string str = fieldValue.Replace(text, newValue);
return text + str + text;
}
private IEnumerable<string> ValuesForErrorFile()
{
yield return lineNumber;
yield return message;
yield return identifier;
yield return type;
}
}
}