public ActionResult SetJson([FromBody] Temp json) { if (json?.Json == null) { return(NoContent()); } service.SetJson(json.Json); return(Ok()); }
public ActionResult SetJson(HttpPostedFileBase upload) { if (upload != null) { var reader = new StreamReader(upload.InputStream); string json = reader.ReadToEnd(); service.SetJson(json); } return(Redirect(Request.UrlReferrer.AbsolutePath)); }