public ActionResult Get() { try { var rec = new CommentRecord { Id = Guid.NewGuid().ToString(), Author = "Herb", Text = "So, whats going on!" }; var result = JSonStoreWrapper.N.BiggyList.ToArray(); return(new JsonResult(result)); } catch (Exception e) { throw; } }
public ActionResult Create([FromForm, Required] string author, string text) { if (string.IsNullOrEmpty(author)) { return(new HttpStatusCodeResult((int)HttpStatusCode.BadRequest)); } if (string.IsNullOrEmpty(text)) { return(new HttpStatusCodeResult((int)HttpStatusCode.BadRequest)); } var rec = new CommentRecord { Id = Guid.NewGuid().ToString(), Author = author, Text = text }; JSonStoreWrapper.N.BiggyList.Add(rec); return(new HttpOkResult()); }