I am trying to sort my members alphabetically by first name and last name, but i can only get it to work with one property. How do I add more?
@{
var x = Member.GetAll;
foreach (var item in x.OrderBy(z => z.getProperty("NameFirst").Value.ToString(), z => z.getProperty("NameLast").Value.ToString())) {
var id = item.Id;
var first = item.getProperty("NameFirst").Value.ToString();
var middle = item.getProperty("NameMiddle").Value.ToString();
var last = item.getProperty("NameLast").Value.ToString();
<li>
<a href="#@id">@first @middle @last</a>
</li>
}
}
Sort members by more custom properties
Hi,
I am trying to sort my members alphabetically by first name and last name, but i can only get it to work with one property. How do I add more?
Thank you for your help! :-)
/Daniel
Hi Daniel,
Did you try to use .ThenBy() ?
Thanks
Thank you sir!
I hope you will have a merry christmas! :-)
/Daniel
is working on a reply...