While searching the solution I found How would I get all pages using core service? where it get list of SG while providing publication URI as RepositoryItemsFilterData . I am trying to use it to get the list of pages in an SG. However when I give SG TCM ID as RepositoryItemsFilterData core service gives me error 'Unexpected item type: StructureGroup.' I am writing code something like below. Can someone help to me on how to get pages when you have SG TCMID.
public List<string> PagesToRemove(string structureGroupTCMID)
{
var itemTypes = new List<ItemType>();
itemTypes.Add(ItemType.Page);
var filter = new RepositoryItemsFilterData();
filter.Recursive=true;
filter.ItemTypes = itemTypes.ToArray();
var listXml =_CoreServiceClient.GetList(structureGroupTCMID, filter);
List<string> lstPageTCMID = new List<string>();
//code to map listXml to lstPageTCMID
return lstPageTCMID;
}