How do I sort a list on a nullable int property using System.Collections.Generic.List<T>.Sort?
Or do I have to do a manual sort because that’s not possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First you need to decide how a null value compares with items with a value. Then you can perform the comparison. For example if you decide that null is always “less than” a non-null: