score:1

Accepted answer

I think you need the following- (if not then let me know)

List<ComputerCard> SortedCards = cards.OrderBy(                    
                   x => x.CardRoles.Sum(y => y.DependentRoles.Count))
                   .ToList();
foreach (var item in SortedCards)
{
    item.CardRoles = item.CardRoles
           .OrderByDescending(x => x.DependentRoles.Count).ToList();
}

score:1

Try this:

 var ordered = cards.SelectMany(c => c.CardRoles.Select(r => new { Card = c, Role = r }))
      .OrderBy(a => a.Role.DependentRoles.Count)
      .ThenBy(a => a.Card.ComputerName)
      .ThenBy(a => a.Role.RoleName)
      .Select(c => c.Card);

Related Query

More Query from same tag