public JsonResult AverageGrade(string id) { MongodbFunctions mongo = new MongodbFunctions(); ObjectId objID = new ObjectId(id); List <double> lista = mongo.AverageGrade(objID); return(Json(new { number = lista[1], grade = lista[0] }, JsonRequestBehavior.AllowGet)); }