using System.Threading.Tasks;
using System.Collections.Generic;
public static void Main()
var customers = GetCustomers();
var count = customers.Count();
Console.WriteLine($"There are {count} customers");
foreach (var customer in customers)
Console.WriteLine(customer);
static IEnumerable<Customer> GetCustomers()
Console.WriteLine("Reading from file..");
var lines = new List<string>(2)
foreach (var line in lines)
var splitLine = line.Split(',');
yield return new Customer(splitLine[0], int.Parse(splitLine[1]));
record Customer(string FullName, int Age);