I am relatively new to Json.net. I have to parse a JSON which I am getting as an URL.
My Code Looks:
var url = "some json url";
using (WebClient wc = new WebClient())
{
wc.UseDefaultCredentials = true;
JArray arr = JArray.Parse(wc.DownloadString(url));
var holdingRecords = arr.ToObject<List<HoldingData>>();
}
This work fine with ConsoleApp. As soon as I put this in my ASP.net, wc.DownloadString(url) return OutOfMemory error.
HoldingData is a class with a bunch of properties. JSON is array of structure where each structure is a property of a class.
Any clue as of how can I resolve this. My JSON is huge, and I am looking for the best solution.