public ActionResult HubOwnerDestroy([DataSourceRequest] DataSourceRequest request, HubOwnerViewModel hubOwner) { if (hubOwner != null && ModelState.IsValid) { var result = _hubOwnerService.FindById(hubOwner.HubOwnerID); if (result != null) { _hubOwnerService.DeleteHubOwner(result); } } return(Json(ModelState.ToDataSourceResult())); }
public ActionResult DeleteJson([DataSourceRequest] DataSourceRequest request, HubOwnerViewModel viewModel) { var original = _hubOwnerService.FindById(viewModel.HubOwnerID); _hubOwnerService.DeleteHubOwner(original); return(Json(new[] { viewModel }.ToDataSourceResult(request, ModelState))); }