Why can't I use Enumerable.OrderBy on this collection?
I was hoping to use OrderBy on a SPFolderCollection object but after I include System.Linq, OrderBy still does not come up in intellisense.
According to the Documentation, SPFolderCollectionClass inherits from SPBaseCollection which u开发者_开发知识库ses IEnumerable. I thought this was all that I needed, am I missing something?
Most of the LINQ methods require an IEnumerable<T>
, use the Enumerable.Cast
method to convert it.
So x.Cast<SPFolder>().OrderBy(whatever)
.
OrderBy will appear only on a IEnumerable<T> generic class. IEnumerable is different from IEnumerable<T>
Perhaps you mixed up System.Collections.Generic.IEnumerable<T>
interface and System.Linq.Enumerable class
精彩评论