public void UpdateToDoTask(ToDoTask updatedTask) { //removing the original task and adding the new updated task CurrentToDoTasks.Remove(CurrentToDoTasks.Find(t => t.Id == updatedTask.Id)); CurrentToDoTasks.Add(updatedTask); //updating existin properties on the task //CurrentToDoTasks.Where(t => t.Id == updatedTask.Id).Select(t => { t.Name = updatedTask.Name; t.Description = updatedTask.Description; return t; }).ToList(); }
public void AddNewTask(ToDoTask newTask) { CurrentToDoTasks.Add(newTask); }