You need to do something like this:
public static string GetProducts()
// instantiate a serializer
//optional: you can create your own custom converter
var products = context.GetProducts().ToList();
var TheJson = TheSerializer.Serialize(products);
You can reduce this code further but I left it like that for clarity. In fact, you could even write this:
Hope it helps!!