I am writing a program for an SSIS process, and part of what it does is read rows from a data flow and pack them into a List of String Arrays List<string[]>
. My main class contains the Updated List, but I have an EmailBuilder Class which needs to access the Updated List field to write an HTML E-Mail message. Right now, my code looks like this:
Fields
public static List<string[]> Updated = new List<string[]>();
ProcessInputRow
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
if (Row.Missing_IsNull)
{
Updated.Add(new string[] { Row.Name, Row.PreviousOutstanding.ToString(), Row.PreviousDate.ToString(), Row.CurrentOutstanding.ToString(), Row.CurrentDate.ToString()});
}
else
{
Missing.Add(Row.Missing);
}
}
Of course, the problem here is that my field is public, which is a no-no. I tried using the built-in properties:
public static List<string[]> Updated { get; private set; }
But this returns a Null Exception, I assume because at that point I haven't actually created the list. So, how could I implement this code safely? I can't seem to manipulate it such that I can access the field from outside the class without making it a public field. Any input is greatly appreciated.