I am using the FileHelpers nuget to read the files. It works as excepted but it throws me a warning when I tried to debug in Visual Studio.
How to get rid of warning CS0649: Field 'Orders.Freight' is never assigned to, and will always have its default value null
?
class Orders : INotifyRead
{
[FieldFixedLength(10)]
public string Freight;
public void BeforeRead(BeforeReadEventArgs e)
{
if (e.RecordLine.StartsWith("Machine"))
// ||
// e.RecordLine.StartsWith("-"))
e.SkipThisRecord = true;
}
public void AfterRead(AfterReadEventArgs e)
{
// we want to drop all records with no freight
if (Freight == "_raw")
e.SkipThisRecord = true;
}
}