Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
The SPWorkItemCollection class is used in conjunction with the SPWorkItemJobDefinition class, and clients that implement the Microsoft.SharePoint.ISPWorkItemHost interface (internal). Classes derived from SPWorkItemJobDefinition are designed to be driven by the SPTimerService. The SPWorkItemCollection class uses a SQL query to filter work items before queuing them in batches for processing. Work item collections are homogenous by type. That is, each SPWorkItemCollection object contains work items of only one WorkItemType.
There are two primary hosting classes (that is, classes that implement the Microsoft.SharePoint.ISPWorkItemHost interface [internal]) that you can use to process work items: SPSite and SPContentDatabase. Using SPSite as host gives you greater flexibility; using SPContentDatabase allows you to use the SPWorkItemJobDefinition class to process work items at the broadest scope possible—the scope of the content database.
The SPWorkItemJobDefinition class is useful only for processing work item collections and uses the GetWorkItems method to process at one time all of the site collections (SPSite) that are in the content database.