I found the following example regarding the differences between .Select & .SelectMany
public class PhoneNumber { public string Number { get; set; } } public class Person { public IEnumerable<PhoneNumber> PhoneNumbers { get; set; } } IEnumerable<Person> people = new List<Person>(); // Select gets a list of lists of phone numbers IEnumerable<IEnumerable<PhoneNumber>> phoneLists = people.Select(p => p.PhoneNumbers); // SelectMany flattens it to just a list of phone numbers. IEnumerable<PhoneNumber> phoneNumbers = people.SelectMany(p => p.PhoneNumbers); But i can not actually understnad exaclty what is the difference between (Select gets a list of lists of phone numbers , while, SelectMany flattens it to just a list of phone numbers.).
Seond question , what is the difference between writing:-
people.Select(p => p.PhoneNumbers); &
people.Include(p => p.PhoneNumbers);