Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created March 31, 2018 18:20
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/e625943d0df70bfcf2248edbd220e187 to your computer and use it in GitHub Desktop.
Save dance2die/e625943d0df70bfcf2248edbd220e187 to your computer and use it in GitHub Desktop.
private static void CountDemo(List<Order> orders)
{
var march = new DateTime(2018, 3, 1);
var ordersOnAndAfterMarch = orders.Where(order => order.OrderDate >= march);
PrintOrders(ordersOnAndAfterMarch, indentBy: 4);
var orderCountPlacedOnAndAfterMarch = orders.Count(order => order.OrderDate >= march);
WriteLine($"Total Orders Placed On and After March: {orderCountPlacedOnAndAfterMarch}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment