Assume we have a bit of JSON that looks like this:
{
title: "The lowly Interface",
url: "https://dev.to/xyz"
},
This is the C# equivalent
var responseMessage =
new {
title = "The lowly Interface",
url = "https://dev.to/xyz"
};
This mismatch in syntax is the 'new' keyword, and the replacement of ':' with '='.
If we return the responseMessage using Azure Functions like this:
return new OkObjectResult(responseMessage);
The client side browser will receive this information.
{
title: "The lowly Interface",
url: "https://dev.to/xyz"
}
This is why it's better to use a no-sql database instead of this construct; except when one-off responses are needed.
Top comments (0)