I am testing my run() function to make sure it has all the correct things populated by the end of the method. I populate 4 fields from our databases, two strings, and two IEnumerable(string)'s. The idea is to print them all out for all the people I am pulling from the database.
When I only print the string fields, everything works fine. However, when I try to add the Enumerables as well, nothing prints at all. I am also printing a counter so I know the program is still running and working. Does Console ever decide to not print anything at all due to space or something else?
Here's the code that does it:
int i = 0;
foreach (Contact contact in Contact.LoadWithPredicate(getAll))
{
-------other code to populate fields---------
i ++;
Console.WriteLine(i);
//Turn the Enumerables into strings for printing
string firstEnumAsString = String.Join(", ", firstEnumerable.ToArray());
string secondEnumAsString = String.Join(", ", secondEnumerable.ToArray());
Console.WriteLine("Email: " + firstString+ ", correspondance: " + secondString+ ", PAM addresses: " + firstEnumAsString+ ", famousPeople: " + secondEnumAsString);
}
So, as my output, whenever I run the code above, I get an output like this:
1
2
Email: foo@bar.com, correspondance: John, PAM addresses: bar@foo.com, famousPeople: foo, bar, foo
3
4
etc
Problem is, only two people out of the total (~425) show up, the rest of the lines are just numbers. Shouldn't I at least get the strings "Email", and ", correspondence"? It seems like Console is just deciding not to do anything. And I know that the code must reach it because it prints out the integer i just before I call that Console.WriteLine().
On the other hand, whenever I just ask for the two string fields to be printed, the Console displays both fields for all 425 users, right after their corresponding integer. Does anyone know what's happening here? TIA