c# - Enumerable OrderBy - are null values always treated high or low and can this be considered stable behaviour? -
i sorting ienumerable
of objects:
var sortedobjects = objects.orderby(obj => obj.member)
where member of icomparable
type. sort seems put objects obj.member == null
@ top. behaviour want, can consider stable respect future .net frameworks? there way can make 'nulls low' behaviour more explicit?
to make behavior more explicit:
var sorted = objects.orderby(o => o.member == null).thenby(o => o.member);
Comments
Post a Comment