Is there any specific reason why indexing is not allowed in IEnumerable.
I found a workaround for the problem I had, but just curious to know why it does not allow i
One reason can be that the IEnumerable may contain an unknown number of items. Some implementations produce the list of items as you iterate over it (see yield for samples). That does not work very well with accessing items using an index. which would require you to know that there are at least that many items in the list.