nerdexam
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)
  • A
    69% (18)
  • B
    4% (1)
  • C
    4% (1)
  • D
    8% (2)
  • E
    15% (4)

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice