I'm looking for a simple extension to the boilerplate syntax below which will allow sorting on one or more fields and also handle null values.
List<myObject> lstObjs = new List<myObject>();
//Assume this is populated with some instances of myObject - some of which will have null members
//e.g. myObject mo1 = new myObject(1, null, "MO1" null);
lstObjs.Sort((a,b)=> a.FieldA.CompareTo(b.FieldA);
Can anyone assist ...?
Thanks in advance,
5arx