LINQ in Action roller

Navigating related entities returned from LINQ Query?

I was playing around with LINQ today and wondered why code like this won't work: Code Snippet var query = from o in db.Orders select o; foreach( var order in query ) { Console.WriteLine("Order Number: {0}" , order.OrderNumber); foreach( Product in order.Products ) { Console.WriteLine("Product: {0}", product.Name); } } Why doesn't LINQ allow me to navigate related entities like that? It compiles fine but doesn't print the products. Read More...
Published Saturday, July 28, 2007 8:47 PM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication