On Tue, Dec 22, 2009 at 2:39 PM, Dino Viehland <[email protected]> wrote:
> The really interesting thing to me is that this is a closure - either id is in
> a nested function scope or it's in a global scope. I'm not sure how that gets
> transmitted across the wire. Do closures work in LINQ in C# going across to
> a database?
Yep:
int id = 1;
var result = customers.Where(c => c.Id == id);
would become a parametrized SQL query:
SELECT * FROM Customers AS t0 WHERE t0.Id = @p0;
where @p0 is the parameter passed along with the query, with the value 1.
- Jeff
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com