I used the below code to take some items from IEnumerable
, but it is always returning the source as null and count as 0 and actually there are items exists in IEnumerable
private void GetItemsPrice(IEnumerable<Item> items, int customerNumber)
{
var a = items.Skip(2).Take(5);
}
When i try to access a
it has count 0
. Anything goes wrong here?
a.Count()
returns 0, then basically there were at most 2 elements initems
. If you think there were 102 items, I suspect your diagnostics are incorrect. – Broadtailitemid
anditemname
– Viennaitems
to the immediate window look like? – Staritems.Count()
is more than 2. – Broadtaila.Count()
you'd have seen something very different. – Broadtail