Advanced PropertiesFilterParameters


/ Published in: C#
Save to your folder(s)

Short example of how to use the FindCOntentParameters.PropertiesFilterParameters when searching andvanced properties (with special characters)


Copy this code and paste it in your HTML
  1. ics = new ClientServices2.ContentService.ContentServiceClient("WSHttpBinding_IContentService");
  2.  
  3. ClientServices2.ContentService.FindContentParameters fcp = new ClientServices2.ContentService.FindContentParameters();
  4.  
  5. fcp.SessionContext = sessionContext;
  6. fcp.ServiceID = TG4TestApp.Properties.Settings.Default.ServiceID;
  7. fcp.StartPos = startPos;
  8. fcp.MaxResult = maxResult;
  9. fcp.SortOption = sortOption;
  10. // fcp.PropertiesFilter = propertyFilter;
  11. //create PropertiesFilterParam placeholder %1.
  12. ClientServices2.ContentService.PropertiesFilterParameter propParam = new ClientServices2.ContentService.PropertiesFilterParameter();
  13. propParam.PropertyName = "Date"; //name
  14. propParam.PropertyMatchString = "04/07/2011"; //value
  15.  
  16. //create new PropertiesFilterParameters array and add the propParam
  17. fcp.PropertiesFilterParameters = new ClientServices2.ContentService.PropertiesFilterParameter[] { propParam };
  18.  
  19. //set the property filter
  20. fcp.PropertiesFilter = "%1";
  21.  
  22. TG4TestApp.ClientServices2.ContentService.ContentVO[] cs = ics.FindContent(fcp);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.