Something very strange is happening in my program:
I make this request agt.DefaultNr == 1 in the collection and get 3 elements as the result:
IEnumerable<Agent> favAgents =
from agt in builtAgents where agt.DefaultNr == 1 select agt;
For each item, I set DefaultNr = 0
foreach (Agent noFavAgt in favAgents)
{
noFavAgt.DefaultNr = 0;
}
I am making another request, but for some reason my favAgents collection is now empty!
IEnumerable<Agent> smallAgents = (from agt in favAgents
where agt.tempResultCount < 30
orderby agt.tempResultCount descending
select agt);
What's going on here?
Is this a lazy LINQ loading issue?
It looks like there will be some kind of repeated request after I set all the elements = 0, because my collection is empty!
source
share