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(); }
/// <summary> /// Removes Task from the Current Dictionary of Tasks /// </summary> /// <param name="taskId"></param> public void RemoveTask(Guid?taskId) { CurrentToDoTasks.Remove(CurrentToDoTasks.Find(t => t.Id == taskId)); }