Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

enumaration in linq

$
0
0

Why is this happen

ienumerable<object> iee = (ienumarable<object>)this.where(c=>c.condition1 == true); //example satisfy 10 items
//now iee has 10 items


foreach(object o in this.where(c=>c.condition1 == true))
{
	o.condition1 = false;
}

//iee here becomes empty;
the_method_that_will_recieve("sample", iee);


the_method_that_will_recieve(string s, ienumarable<object> ie)
{
	//ie is still empty
	//some process
}

could you help me why the variable iee becomes empty.

thanks.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>