I am trying to get all components based on the schema, I have to ignore one particular tcm ID from the query. as i already have the component object in code. i am unable to do it.
This is my code now
AndCriteria totalCriteria = null;//this will be used for combining all kind of criteria
PublicationCriteria pubCriteria = new PublicationCriteria(myPublicationId);
ItemSchemaCriteria IsFVideSchema = new ItemSchemaCriteria(MySchemaID);
ItemTypeCriteria IsComponent = new ItemTypeCriteria(16);
//Here i want to include one more critera, so that ignore this TCM ID ("tcm:mypub-ItemId-16);
//I want to get all the recent components by schema, it's working fine. But i already have one of component via component presentations //earlier, because of this reason i have to get top 4 components, but query including the one which i already have.
TaxonomyKeywordCriteria taxonomyKeywordCriteria = new TaxonomyKeywordCriteria(catgoryId, keyWordId, false);
SortParameter sortParameter = new SortParameter(SortParameter.ItemLastPublishedDate, SortParameter.Descending);
totalCriteria = new AndCriteria(pubCriteria, IsFVideSchema );
totalCriteria = new AndCriteria(totalCriteria, IsComponent);
totalCriteria = new AndCriteria(totalCriteria, taxonomyKeywordCriteria);
query.Criteria = totalCriteria;
query.AddSorting(sortParameter);
PagingFilter Pagefilter = new PagingFilter(0, limit); //limit is 4 here
query.SetResultFilter(Pagefilter);
string[] ItemUris = query.ExecuteQuery();
Please can anyone help me ?, I just want to get the 4 components excluding this tcm ID. I have to ignore the component in Tridion Query, or else i will get the same component back again. Is there any way ?