Skip to content

Instantly share code, notes, and snippets.

@rossmurray
Last active August 29, 2015 13:56
Show Gist options
  • Save rossmurray/9038282 to your computer and use it in GitHub Desktop.
Save rossmurray/9038282 to your computer and use it in GitHub Desktop.
traditional while loop
void Main()
{
ReadAndSaveRecords();
}
private void ReadAndSaveRecords()
{
bool moreRecords = true;
while(moreRecords)
{
var record = ReadNextRecord();
if(record != null)
{
SaveRecord(record);
}
else
{
moreRecords = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment