Hi Jeff,
I think it's better to use helpers to build sql conditions in C# code for this methods, example:
var whereCondition = new WhereCondition().WhereEquals("TaskType", TaskHelper.GetTaskTypeString(TaskTypeEnum.PublishDocument));
var result = StagingTaskInfoProvider.SelectTaskList(SiteContext.CurrentSiteID, targetServer.ServerID, whereCondition.ToString(true), null);
Maybe you don't see any results because there isn't a task with this type in your database. SelectTaskList
method uses staging.task.selecttasklist
query to get tasks. The body of this query is:
SELECT ##TOPN## ##COLUMNS## FROM Staging_Task WHERE (TaskSiteID IS NULL OR TaskSiteID = @TaskSiteID) AND (TaskID IN (SELECT SynchronizationTaskID FROM Staging_Synchronization WHERE SynchronizationServerID = @ServerID OR (@ServerID <= 0 AND (@TaskSiteID = 0 OR SynchronizationServerID IN (SELECT ServerID FROM Staging_Server WHERE ServerSiteID = @TaskSiteID AND ServerEnabled=1))))) AND (##WHERE##) ORDER BY ##ORDERBY##
You can manually execute this query in database with necessary parameters or you can just select rows from Staging_Task
table to check:
SELECT COUNT(*) FROM Staging_Task WHERE TaskType = 'PUBLISHDOC'