Linq in C#

IEnumerable<Car> cars = new List<Car>()
    { new Car(){wheels = 4, 
                colour = Colour.Red},
      new Car(){wheels = 3, 
                colour = Colour.Blue} };
foreach (var x in from c in cars 
	 where c.colour == Colour.Red
	 select c.wheels) {
    System.Console.WriteLine (x);
}

http://msdn.microsoft.com/en-us/netframework/aa904594.aspx

Datenquellen: Collections, XML, DB



Johannes Waldmann 2011-07-07