Hi Simon,
Page Selector saves NodeGuid value in database table. So your query will be like:
var RelatedPage1 = ValidationHelper.GetGuid(CurrentDocument.GetValue("RelatedPage1"), Guid.Empty);
...
var RelatedPages = DocumentHelper.GetDocuments("csm.casestudy")
.Path("/our-work/%")
.WhereEquals("NodeGuid", RelatedPage1)
.Or().WhereEquals("NodeGuid", RelatedPage2)
.Or().WhereEquals("NodeGuid", RelatedPage3)
.ToList();
Or another variant:
var query = DocumentHelper.GetDocuments("csm.casestudy").Path("/our-work/%");
for (var i = 1; i <= 3; i++)
{
var relatedPage = ValidationHelper.GetGuid(CurrentDocument.GetValue("RelatedPage" + i), Guid.Empty);
if (relatedPage == Guid.Empty) continue;
if (i > 1) query = query.Or();
query = query.WhereEquals("NodeGuid", relatedPage);
}
var relatedPages = query.ToList();