Sunday, 9 October 2016

WHY YOU DON’T NEED THE “USING” STATEMENTS IN ITERATING THROUGH LINQ QUERIES WITH FOREACH LOOP



WHY YOU DON’T NEED THE “USING” STATEMENTS IN  ITERATING THROUGH LINQ QUERIES WITH FOREACH LOOP.
If you are using linq-sql queries you don’t need to open and close the database.
This is one of the reasons why!
Foreach loop implements the IDisposable Interface.
Here is the backend view of what for each loop does.



No comments:

Post a Comment