public bool Update(int idTask, TaskModel modifiedModel) { var model = (TaskModel)GetById(idTask); try { if (repo.Update(model, modifiedModel)) { var originalTaskIndex = TasksSingleton.Instance.Tasks.IndexOf(TasksSingleton.Instance.Tasks.Where(t => t.IdTask == idTask).FirstOrDefault()); TasksSingleton.Instance.Tasks[originalTaskIndex] = modifiedModel; } return(true); } catch (Exception ex) { throw ex; } }