I have a class defined and I write records to this class to a List. Having trouble sorting the list before I write an error report. I\'m trying to sort the list alphabetically b
Firstly its just
List1.Sort();
Sort method return nothing. It just sorts the list.
Secondly if you want to sort based on a property do this
List<Types> sortedlist = List1.OrderBy(x => x.finderror).ToList();
I think you want List1 = List1.OrderBy( x => x.finderror ).ToList();
List1 = List1.OrderBy( x => x.finderror ).ToList();