How should you complete the code?

DRAG DROP
You have a class named Product that has a property named Name.
You have the following code.

You need to get the Name property of oneProduct.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets. Each code element may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

microsoft-exams

2 thoughts on “How should you complete the code?

  1. string productName = oneProduct.GetType().GetProperties().First(prop => prop.Name == “Name”).GetValue(oneProduct).ToString();

  2. Wrong. There test answer is GetType().GetProperties().First(….).GetValue(oneProduct).ToString();
    test via code

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.