using System.Diagnostics;
using System.Collections.Generic;
public static void Main()
List<Customer> customers = new List<Customer>();
for (int i = 0; i <= 100; i++) {
Customer customer = new Customer {
CustomerName = string.Format("Customer{0}", i)
Stopwatch stopWatch = new Stopwatch();
if (customers.Count > 0) {
Console.WriteLine("Time consumed with count: {0}", stopWatch.Elapsed);
Console.WriteLine("Time consumed with Any: {0}", stopWatch.Elapsed);
public int CustomerId { get; set; }
public string CustomerName { get; set; }