Exemplo n.º 1
0
        public ActionResult Delete([DataSourceRequest] DataSourceRequest request, CommentEditAdminViewModel model)
        {
            if (model != null)
            {
                this.comments.Delete(model.Id);
            }

            return(this.Json(new[] { model }.ToDataSourceResult(request, this.ModelState)));
        }
Exemplo n.º 2
0
        public JsonResult Edit([DataSourceRequest] DataSourceRequest request, CommentEditAdminViewModel model)
        {
            if (model != null && this.ModelState.IsValid)
            {
                this.comments.Update(model.Id, model.Content, model.AuthorEmail);
            }

            return(this.Json(new[] { model }.ToDataSourceResult(request, this.ModelState)));
        }