/// <summary> /// Removes work items from this job based on the contents of a recipient list. /// </summary> /// <remarks> /// Deletes all work items with email addresses that also exists in a recipient list /// </remarks> /// <param name="recipientListId">The id of the recipient list to use as filter.</param> public int FilterOnRecipients(int recipientListId) { if (_id <= 0) { throw new ArgumentException("Cannot filter work items for a job without id. Please save the job first."); } WorkItemData dataUtil = GetWorker <WorkItemData>(); int count = dataUtil.WorkItemFilterAgainstRecipientList(_id, recipientListId); // Remove any workitems from memory _workItems = null; // Counters are no longer valid ResetStatusCounters(); return(count); }