Posted By

patriksvenssonmpsbroadbandcom on 05/16/11


Tagged

MPP


Versions (?)

Advanced PropertiesFilterParameters


 / Published in: C#
 

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

  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  

You need to login to post a comment.