Microsoft
70-516 · Question #241
The application must provide a component part list for any product. The component part list must give the quantity of each distinct part that is required to manufacture that product. You need to…
The correct answer is A. IEnumerable < Tuple < int , Part>> result = part.Descendants . GroupBy (p => p). See the full explanation below for the reasoning.
Question
The application must provide a component part list for any product. The component part list must give the quantity of each distinct part that is required to manufacture that product. You need to create a LINQ expression that delivers a result of type IEnumerable<Tuple<int, Part>> to meet the requirements. Which expression should you use?
Options
- AIEnumerable < Tuple < int , Part>> result = part.Descendants . GroupBy (p => p).
- BIEnumerable < Tuple < int , Part>> result = part.Descendants . ToDictionary (c => c).
- CIEnumerable < Tuple < int , Part>> result = part.Children . GroupBy (p => p).Select(g =>
- DIEnumerable < Tuple < int , Part>> result = part.Children .Distinct(). GroupBy (p => p).
- EIEnumerable < Tuple < int , Part>> result = part.Descendants .Distinct(). GroupBy (p =>
How the community answered
(26 responses)- A69% (18)
- B4% (1)
- C4% (1)
- D8% (2)
- E15% (4)
Community Discussion
No community discussion yet for this question.