This can be done as
list.Sort( (emp1,emp2)=>emp1.FirstName.CompareTo(emp2.FirstName) );
The .NET framework is casting the lambda (emp1,emp2)=>int
as a Comparer<Employee>.
This has the advantage of being strongly typed.
If you need the descending/reverse order invert the parameters.
list.Sort( (emp1,emp2)=>emp2.FirstName.CompareTo(emp1.FirstName) );
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…