'System.Xml.Linq.LoadOptions' is a 'type' but is used like a 'variable'.
var options = new System.Data.Linq.DataLoadOptions();
options.LoadWith(customer => customer.Orders);
LoadOptions = options;
I've tried this.LoadOptions (no luck). I'm using LinqPad 4.42.01. This seems to happen when I connect to a Northwind DB SQL Server 2008 R2, but not when I'm connected to NutShell.mdf in SQL Express. Also, notice that I have to fully qualify DataLoadOptions in line 1 or it can't be found. What's going on?
options.LoadWith(customer => customer.Orders);
LoadOptions = options;
I've tried this.LoadOptions (no luck). I'm using LinqPad 4.42.01. This seems to happen when I connect to a Northwind DB SQL Server 2008 R2, but not when I'm connected to NutShell.mdf in SQL Express. Also, notice that I have to fully qualify DataLoadOptions in line 1 or it can't be found. What's going on?
Comments
Customers.Include ("Orders").Dump();
this.Configuration.LazyLoadingEnabled = false;
or, if you're using ObjectContext rather than DbContext:
this.ContextOptions.LazyLoadingEnabled = false;
Or, if you're using the default LINQ to SQL driver:
this.DeferredLoadingEnabled = false;