I am playing with Azure Functions. However, I feel like I\'m stumped on something pretty simple. I\'m trying to figure out how to return some basic JSON. I\'m not sure how to cr
JSON is pretty easy, Newtonsoft.Json library is a special case. You can include it by adding this at the top of the script file:
#r "Newtonsoft.Json"
using Newtonsoft.Json;
Then your function becomes:
public static string GetJson()
{
var person = new Person();
person.FirstName = "John";
person.LastName = "Doe";
person.Orders = new List();
person.Orders.Add(new Order() { Id=1, Description="..." });
return JsonConvert.SerializeObject(person);
}