An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Try this:
class MyObject
{
public string Name { get; set; }
public int Count { get; set; }
}
. . . .
List<MyObject> results = mylist.GroupBy( n => n.LastName ).Select( g => new MyObject { Name = g.Key, Count = g.Count( ) } ).ToList( );