public ActionResult GetTaskById(int idTask) { user.ValidateUser(); try { var task = taskBusiness.GetTaskById(idTask); task.LastDescriptionReason = taskBusiness.GetLastReasonDescription(task.IdStep, idTask)?.Description ?? ""; var newTask = new tasks { IdTask = task.IdTask, Title = task.Title, Description = task.Description, IdStep = task.IdStep, IdPriority = task.IdPriority, StartDate = task.StartDate, EndDate = task.EndDate, LastDescriptionReason = task.LastDescriptionReason }; return(Json(JsonConvert.SerializeObject(newTask), JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(new HttpStatusCodeResult(404, ex.Message)); } }