nerdexam
Microsoft

70-516 · Question #230

The application UI displays a list of products in alphabetical order. To display each product, the UI requires the va of the product Id field and the product Name field. You need to write a LINO…

The correct answer is D. var productNaraes = from prcduct in context.Parts.OfType<Product>()-ToList(). See the full explanation below for the reasoning.

Question

The application UI displays a list of products in alphabetical order. To display each product, the UI requires the va of the product Id field and the product Name field. You need to write a LINO query that returns the product name and unique identifier without retrieving any other database columns. The query must create an anonymous type with a field named ProductName that contains the product name and a field named Id that contains the unique identifier. Which query expression should you write?

Options

  • Avar productNaraes = from produce in context.Pares.OfType<Produet>()
  • Bvar productNames = from product in context.Parts where product is Product
  • Cvar produceNanes = from preduce in context.Pares orderby product.Name ascending
  • Dvar productNaraes = from prcduct in context.Parts.OfType<Product>()-ToList()

How the community answered

(69 responses)
  • A
    17% (12)
  • B
    7% (5)
  • C
    4% (3)
  • D
    71% (49)

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice