Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created April 14, 2018 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/6c2ce82f63d7772a675dc0a3e073f136 to your computer and use it in GitHub Desktop.
Save dance2die/6c2ce82f63d7772a675dc0a3e073f136 to your computer and use it in GitHub Desktop.
private static void TakeDemo(List<Order> orders)
{
var firstTwoOrders1 = orders.Take(2);
PrintHeaderFooter("First Two Orders - Take", () => PrintOrders(firstTwoOrders1, indentBy), indentBy);
var firstTwoOrders2 = orders.TakeWhile((order, index) => index <= 1);
PrintHeaderFooter("First Two Orders - TakeWhile", () => PrintOrders(firstTwoOrders2, indentBy), indentBy);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment