LINQ in Action roller

Linq to Sql - AssociateWith generates awful query

I wrote the following piece of code using ( NorthwindDataContext context = new NorthwindDataContext ()) { DataLoadOptions loadOptions = new DataLoadOptions (); loadOptions.AssociateWith Customer >(c => c.Orders.Take(5)); context.LoadOptions = loadOptions; var customers = from c in context.Customers select c; foreach ( var c in customers) { foreach ( var o in c.Orders) { Console .WriteLine(o.OrderID); } } } When I run this codeĀ I expect the sql profiler to show me something like this in the first Read More...
Published Sunday, May 25, 2008 7:16 PM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication