public Task AddTask(Bug bug, int size, string description, TimeSpan?maxWait = null) { var timeSpent = maxWait ?? TimeSpan.Zero; var toAdd = new Task(TaskRepository.GetNextId(), bug, description, size, timeSpent); bug.Tasks.Add(toAdd); TaskRepository.AddItem(toAdd); return(toAdd); }
public void AddTask(Task newTask) { newTask.ManagerID = newTask.Manager.ID; newTask.CreatorID = newTask.Creator.ID; newTask.ExecutorID = newTask.Executor.ID; newTask.Manager = null; newTask.Executor = null; newTask.Creator = null; TaskRepository.AddItem(newTask); }