By default LINQ uses deferred query execution. This means when you write a LINQ query it doesn't execute. LINQ queries execute when you 'touch' the query results. This means you can change the underlying collection and run the same query subsequent times in the same scope. Touching the data means accessing the results, for instance in afor loop or by using an aggregate operator like Average or AsParallel on the results.

In this article I am using Visual Studio 2010, beta 1 and the .NET Framework 4.0. (The .NET Framework 4.0 will let you access Parallel extensions, which are used to illustrate touching the data.)

Before you begin to test the demo, select Project|project name Properties. Click on the Compile tab and the Advanced Compile Options in the low-center of the Compile tab. Change the Target framework (all configurations) option to .NET Framework

Read More....

I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too. 

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.