CompiledQueryのパフォーマンスを調査していますが、CompiledQueryはLoadWithにアレルギーがあります。
using (CustomDataContext myDC = new CustomDataContext())
{
DataLoadOptions options = new DataLoadOptions();
options.LoadWith<Customer>(c => c.Orders)
myDC.LoadOptions = options;
IQueryable<Customer> query = myDC.Customers.Where(filterExpr);
List<Customer> result = query.ToList();
return result;
}
このコードは、左結合SQLクエリを発行することによってロードされた各CustomerインスタンスのOrdersプロパティにデータを入力します。LoadWithなしでクエリを書き直して同じ結果を得るにはどうすればよいですか(顧客はOrdersプロパティにデータを入力しています)?