I'm making a database call with linq and it is returning some results to me. Following is the code for the same:
var resultSet = DataContext.GetList(id);
foreach(var result in resultSet)
{
// do something here with result
}
After this, I try to access again same resultSet as below:
foreach(var result in resultSet)
{
// do something here with result
}
When I'm in debug mode it doesn't throw any error, instead it simply exits debug mode and execution is completed and focus comes back to page.
I want to know why it is not throwing any error in debug mode that I'm using the enumeration for the second time? Am I missing anything? All other errors are throwing exceptions even in the debug mode.
Update: I intentionally didn't do that second calling. It was done by mistake, but it took sometime for me to find that error, if it would have thrown an error, then I would have easily fixed it. This is reason I posted this question here.
Note: I'm doing this throw a ajax call.