I have a class Users:
class User
{
public string Name { get; set; }
public Address Address { get; set; }
public DateTime Birthday { get; set; }
}
Then I have a list of users like List<User> users
.
And I meet with the problem which sounds "How to order list by Name length string property?
I've tried something like this:
users.OrderBy(user=>user.Name.Length);
and unfortunately it didn't work.
Thanks for the reply and best regards.