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.
Pages
▼
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 :-))
thanks! Helpful for me!
ReplyDeleteThanks! Helpful for me!
ReplyDeletenice , with description information
ReplyDelete