News:
public List GetNonSecretUsers() { string[] secretUsers = {"@secretUser", "@admin", "@root"}; List allpeople = GetAllPeople(); ... }
You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list. The resulting list must not contain duplicates. Which code segment should you use?
var secretPeople = (from p in allPeople from u in secretUsers where p.UserId == u select p).Distinct(); return allPeople.Except(secretPeople);
return from p in allPeople from u in secretUsers where p.UserId != u select p;
return (from p in allPeople from u in secretUsers where p.UserId != u select p).Distinct();
List people = new List( from p in allPeople from u in secretUsers where p.UserId != u select p); return people.Distinct();