Ok, I need a sanity check here ...
I compiled a query that returns IQueryable when it is executed.
On which line (s) should the query against the database be executed 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>();
This is how I define a 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 ||
FOR ADDITIONAL DISCUSSION PLEASE REQUEST: LINQ to SQL compiled queries and when they are executed
Adam ritenauer
source share