I'm wondering what's the difference between the groupBy and the ToLookup Extension Method.
Let us have a List of objects like this:
public class Person
{
public uint Id { get; set; }
public string Name { get; set; }
public DateTime Birthday { get; set; }
}
List<Person> People { get; set; }
Now i can use the Extension Methods above:
var groupedPeople = People.GroupBy((x) => x.Id);
var lookupPeople = People.ToLookup((x) => x.Id);
What's the difference between those statements?
Thanks in advance.
Marco B.