I have an array of (always 4) objects, which I need to order by descending value of an object member.
I had thought to order it as
Array = Array.OrderByDescending(p => p.Val)
This fell over when one of the values was null, of course. So what I am aiming for, but my LINQ is not up to, is:
Array = Array.OrderByDescending(p => if( p != null ) p.Val; else float.MinValue)
How can I accomplish this ordering without having to delete and later re-add the null value? Thanks for your help.