15 December 2011

SPListItem​Collection to Linq List

This time you code gives us extension to SPListItemCollection object.

SPListItem​Collection to Linq List

If you want to work with the object of SPListItemCollection using linq - The following code can help

public static List<SPListItem> ToList(this SPListItemCollection items)
{
    IEnumerable<SPListItem> itemsContiens = items.OfType<SPListItem>();
    return itemsContiens.ToList<SPListItem>();
}

Yours...
Roi

1 comment:

Anonymous said...

Great! Thanks a Lot!

Post a Comment