Okay I need a sanity check here...
I've compiled a query that returns an IQueryable when executed.
On what line(s) should the query actually execute against the database in the following example?
101 IQueryable<T> results = MyCompiledQuery(MyDataContext);
102 List<T> final = (from t in result
103 where t.ID > 5
104 select t).ToList<T>();
Here is how I define the compiled query
public static Func<MyDataContext, IQueryable<Widget>> MyCompiledQuery=
CompiledQuery.Compile<MyDataContext, IQueryable<Widget>>(
(MyDataContext db) =>
from w in db.Widgets
where ((w.Type == WidgetType.Atype || //Widget.Atype is a Linq to Sql object, that I've defined statically
w.Type == WidgetType.Btype || //See above comment
w.Type == WidgetType.Ctype ) && //See above comment
w.Location == WidgetLocation.Domestic) //Samething applies here
select euc);
FOR ADDITIONAL DISCUSSION PLEASE REFER TO: LINQ to SQL compiled queries and when they execute