I am having to do this:
foreach (ItemClass item in items)
{
if (item == null) { logger.Debug("No item found"); continue; }
//do something with item
}
This is really irritating as I didn't know this and now I find myself with strange errors.
Perhaps there is a better way to loop though all of the members of a collection in C#?

New Topic/Question
Reply



MultiQuote





|