Public Class History Property OldValue As String Property NewValue As String Property UpdatedOn As DateTime Property ByWhom As String End Class Dim lstHistory As New List(of History) lstHistory.Add(new History.....) 'And you have added few history objects in it.Now we will sort it on "UpdatedOn" property.
For Ascending: lstHistory.Sort(Function(x, y) x.UpdatedOn.CompareTo(y.UpdatedOn)) For Descending: lstHistory.Sort(Function(x, y) y.UpdatedOn.CompareTo(x.UpdatedOn))
No comments:
Post a Comment