, SPWeb , SPListItemCollection, , .
, :
private IEnumerable<SPListItem> AllItems;
public void GetItems()
{
var results = SPContext.Current.Web.Lists[ListName].Items.Cast<SPListItem>();
this.AllItems = results;
}
and then I use AllItems everywhere and it works great.
If you are interested, then the action is carried out, so I can use Linq in the result set - much faster than sending a request to the list, especially if you make several subqueries in the data.
source
share