public ActionResult GetExamQuestions(string id) { var result = services.GenerateQuestion(id); if (result != null) { var serializedResult = JsonConvert.SerializeObject(result, Formatting.Indented, new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore, MaxDepth = 1, NullValueHandling = NullValueHandling.Ignore, DateFormatHandling = DateFormatHandling.IsoDateFormat }); var deserializedResult = JsonConvert.DeserializeObject <Dictionary <string, List <Question> > >(serializedResult); return(Json(new { success = true, data = deserializedResult }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } }