I have a List that holds the URLs of the Subsites I want to retrieve. I need to use that as a filter (optimize the query) so when I query the SharePoint it only returns the webs I want to work with. I'm using CSOM and I was trying this query:
List<string> listOfSites = new List<string>(); // lets consider this has been populated var query = from webs in subsites where listOfSites.Contains(webs.Url) select webs; IEnumerable<Web> webz = clientContext.loadQuery(query);
I can't use Contains, ClientContext throws an exception when I try to use it. Do I have any alternative?