public JsonResult HideTask(int id) { var jsonSuccessResult = new JsonSuccessResult(); try { UserTasks.DoneTask(id); jsonSuccessResult.Success = true; } catch (Exception ex) { jsonSuccessResult.Errors = new string[] { ex.Message }; jsonSuccessResult.Success = false; } return(new JsonResult() { Data = jsonSuccessResult }); }