Question 2


Question

Drag and Drop
You are developing an ASP.NET Web API action method for F2J.com application.

The action method must return the following JSON in the message body.

{ " Name ":" Fabrikam", "VendorNumber": 9823, "Items": ["Apples", "Oranges"] }

You need to return an anonymous object that is serialized to JSON.

What should you do? (To answer, drag the appropriate code segments to the correct location or locations in the answer area. Each code segment 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.

  • "Fabrikam", VendorNumber = 9823,
  • "Fabrikam", VendorNumber = "9823"
  • new List<string> { "Apples", "Oranges"}
  • new List<string> {"Apples, Oranges"}
  • return new List<string>
  • return new
public object Get()
{
    {
    Name =

      Items =

        }
        }

        Answer:

        • "Fabrikam", VendorNumber = 9823,
        • new List<string> {"Apples, Oranges"}
        • return new List<string>
        public object Get()
        {
        • return new
        {
        Name =
        • "Fabrikam", VendorNumber = "9823"

        Items =
        • new List<string> { "Apples", "Oranges"}

        }
        }