public IActionResult KendoDestroy([DataSourceRequest] DataSourceRequest request, CoreModel model)
        {
            string deleteMessage = string.Empty;

            try
            {
                _service.Delete(model.CoreId);
            }
            catch (Exception ex)
            {
                deleteMessage = CommonHelper.GetErrorMessage(ex);
            }

            ModelState.Clear();

            if (!string.IsNullOrEmpty(deleteMessage))
            {
                ModelState.AddModelError(deleteMessage, deleteMessage);
            }

            return(Json(new[] { model }.ToDataSourceResult(request, ModelState)));
        }
Exemple #2
0
        public ActionResult DeleteCategory(int id)
        {
            var res = _coreService.Delete(id);

            return(Ok(res));
        }
Exemple #3
0
 public void Delete(string id)
 {
     _client.Delete(id);
 }