public ActionResult Destroy([DataSourceRequest] DataSourceRequest request, ViewModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                this.Data.Comments.Delete(model.Id);
                this.Data.SaveChanges();
            }

            return(this.GridOperation(model, request));
        }
        public ActionResult Create([DataSourceRequest] DataSourceRequest request, ViewModel model)
        {
            var dbModel = base.Create <Model>(model);

            if (dbModel != null)
            {
                model.Id = dbModel.Id;
            }
            return(this.GridOperation(model, request));
        }
        public ActionResult Update([DataSourceRequest] DataSourceRequest request, ViewModel model)
        {
            if (model != null && ModelState.IsValid)
            {
                var dbModel = this.GetById <Comment>(model.Id);

                dbModel.Content = model.Content;

                this.ChangeEntityStateAndSave(dbModel, EntityState.Modified);
                model.ModifiedOn = dbModel.ModifiedOn;
            }

            return(this.GridOperation(model, request));
        }