Tip 29 – How to avoid LazyLoad or Load() reader issues

If you have code that looks like this: var results = from c in ctx.Customers                    where c.SalesPerson.EmailAddress == “…”                    select c; foreach(var customer in results) {     Console.WriteLine(customer.Name);     if (IsInteresting(customer))     {         customer.Orders.Load();         foreach(var order in customer.Orders)         {              Console.WriteLine(“\t” + order.Value);         }     } } This code…

1