I need to validate a json file from server side, Im using asp.net mvc with c#, so I have this method in my controller
public ActionResult Validate(HttpPostedFileBase jsonFile)
{
bool validJson = false;
var serializer = new JavaScriptSerializer();
try
{
var result = serializer.Deserialize<Dictionary<string, object>>(How should I pass the json file here ??);
validJson = true;
}
catch(Exception ex)
{
validJson = false;
}
}
This is the best way for validate it ? ... sorry but I don't know how to pass the json string parameter, I have tried with jsonFile.InputStream.ToString(), jsonFile.tostring() ... what it needs ?, json user's route ? ... thanks in advance