"Reverse your
ifcriteria and usecontinue. That will eliminate the need for a bigifblock and make the code more readable."
You can use the continue statement to avoid deeply nested conditional code, or to optimize a loop by eliminating frequently occurring cases that you would like to reject.
foreach (var item in foo)
{
if(item != null)
{
...
}
}should be 🡻
foreach (var item in foo)
{
if(item == null) continue;
...
}