Amastaneh blog is a discussion site on software development, programming, algorithms, software architectures,software run-time errors and solutions from software engineers who love building great softwares.
June 30, 2011
Cannot apply indexing with [] to an expression of type System.Collections.Generic.IEnumerable
Error: Cannot apply indexing with [] to an expression of type 'System.Collections.Generic.IEnumerable<ANY_TYPE>
Solution:
If used of IEnumerable SampleArray then you can access to elements like:
- SampleArray[index]WRONG
- SampleArray.ElementAt(index)RIGHT
Because the IEnumerableinterface dose not support of [] for indexing :-))
3 comments:
thanks! Helpful for me!
Thanks! Helpful for me!
nice , with description information
Post a Comment