Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LinqToSql Question
Message
General information
Forum:
ASP.NET
Category:
LINQ
Miscellaneous
Thread ID:
01486527
Message ID:
01486631
Views:
47
>I think you're wrong about needing ToList() at all - the FirstOrDefault() will execute the query. Kevin's original code with the using would work fine

Yeah, I just tested this with the profiler and it appears to run immediately. I guess I assumed it was delayed (but then, it returns a single type not an IQueryable so I guess it would have to run immediately).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Reply
Map
View

Click here to load this message in the networking platform