using System; using System.Collections.Generic; using System.Linq; public class Example1{ public static void Main(){ // The average age of all females: IEnumerable ages = from p in Person.SomePersons where p.Sex == Sex.Female select p.Age; double result = ages.Average(); Console.WriteLine("Result = {0}", result); // Result = 37,3333333333333 } }