Timeline for Nesting Linq-to-Objects query within Linq-to-Entities query –what is happening under the covers?
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 6, 2012 at 17:58 | vote | accept | carewithl | ||
| Nov 6, 2012 at 17:58 | comment | added | carewithl | thank you for your input - your post deserves to be marked as answered, though I'd still like someone to tell with 100 % certainty whether my assumptions were correct ;) | |
| Nov 5, 2012 at 22:05 | history | edited | Scott Whitlock | CC BY-SA 3.0 | added 724 characters in body |
| Nov 5, 2012 at 21:58 | comment | added | Scott Whitlock | @carewithl - that's interesting. | |
| Nov 5, 2012 at 21:44 | comment | added | carewithl | Could you please see my edit? | |
| Nov 5, 2012 at 21:00 | history | edited | Scott Whitlock | CC BY-SA 3.0 | added 598 characters in body |
| Nov 5, 2012 at 20:54 | comment | added | Scott Whitlock | @carewithl - that should only happen if you did c.ReturnSomeNumber() because you're invoking it on a target of the query. Perhaps the Linq2Entities provider isn't as advanced as I'm used to, but there's nothing that says it can't evaluate it. | |
| Nov 5, 2012 at 19:17 | comment | added | carewithl | "Presumably the data provider looks at each sub-expression and if it can be computed it just does a compile and execute while it's constructing the query." I'm not sure that is correct, else wouldn't data provider be able to execute any methods, even those defined by me? In other words, if I replace in my code "where c.ContactID == numbers.Max()" with "where c.ContactID == myClass.ReturnSomeNumber()", then I get "NotSupportedException: LINQ to Entities does not recognize the method 'Int32 ReturnSomeNumber()' method, and this method cannot be translated into a store expression."? | |
| Nov 5, 2012 at 18:39 | history | answered | Scott Whitlock | CC BY-SA 3.0 |