Can someone please explain why this works. I want to retrieve all property listings where the proeprtyCategory value is set to 'To Let' in a drop down data type
var propertiesToLet = Model.Content.Descendants("propertyListingPage").Where(x => x.GetPropertyValue<bool>("propertyCategory")).ToList().OrderBy("CreateDate desc");
and this doesnt
var propertiesToLet = Model.Content.Descendants("propertyListingPage").Where(x => x.GetPropertyValue<string>("propertyCategory == To Let")).ToList().OrderBy("CreateDate desc");
Getting dropdown property value from descendant
Hi All,
Can someone please explain why this works. I want to retrieve all property listings where the proeprtyCategory value is set to 'To Let' in a drop down data type
and this doesnt
many thanks
Paul
I think just a little syntax issue:
Hi,
Above example works for a single dropdown value, but if dropdown enabled with multiple choice then how to compare the value in the where clause?
Hi Jeavon,
Thanks for the response, sorry for the late reply ive been out all day.
You are absolutely correct though, what you suggested works just fine.
Thanks for you help
Paul
Great!
is working on a reply...