public class UserLastSeen
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime LastSeen { get; set;}
}
public class UserLastSeenSorter
{
public void GetSortedList()
{
List(Of UserLastSeen) userList = GetUserList()
userList.Sort(AddressOf UserLastSeenDescendingComparer)
}
private Function UserLastSeenDescendingComparer(ByVal user1 As UserLastSeen, _ ByVal user2 as UserLastSeen) As Integer
{
Return user2.LastSeen.CompareTo(user1.LastSeen)
}
}
This worked great and was very easy.
No comments:
Post a Comment