public ActionResult GetTotals(string vote_id) { IEnumerable <TallyInfo> totals = TotalStore.GetTotals(vote_id); return(Json(new { code = ResultCode.Success, totals = totals, }, JsonRequestBehavior.AllowGet)); }
public override void ExecuteResult(ControllerContext context) { TextWriter writer = context.HttpContext.Response.Output; IEnumerable <TallyInfo> totals = TotalStore.GetTotals(this.voteId); string output = JsonConvert.SerializeObject(totals); writer.Write(output); }