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

DRAG DROP
You are developing an ASP.NET Web API action method.
The action method must return the following JSON in the message body.
{“Name”: “Fabrikam”, “VendorId” :9823, Items”: [“Dogs”, “Cats”) >
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.)

DRAG DROP
You are developing an ASP.NET Web API action method.
The action method must return the following JSON in the message body.
{“Name”: “Fabrikam”, “VendorId” :9823, Items”: [“Dogs”, “Cats”) >
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.)

Answer:



Leave a Reply 6

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


mene

mene

The answer is wrong, the correct answer is:

[return new]
{
Name = [“Fabrikam”, VentorNumber = 9823,]
Items = [new List { “Dogs”, “Cats”}]
};

hus

hus

mene is right

MD. Golam Mostafa

MD. Golam Mostafa

100% correct

response

response

return new
{
Name = “Fabrikam”, VentorNumber = 9823,
Items = new List { “Dogs”, “Cats”}
};

response

response

corregido:

return new
{
Name = “Fabrikam”, VentorNumber = 9823,
Items = new List { “Dogs”, “Cats”}
};

Test

Test

return new
{
Name = “Fabrikam”, VendorNumber = 9823,
Items = new List { “Dogs”, “Cats”}
};