public bool Delete(MainTask mainTask) { var subtasks = _subTaskRepository.FindByMainProjectId(mainTask.Id); if (subtasks.Any()) { foreach (var subtask in subtasks) { var _sub = new SubTask { Id = subtask.Id }; _subTaskRepository.Delete(_sub); } } return(_mainTaskRepository.Delete(mainTask) > 0); }
public IEnumerable <SubTask> GetByMainTaskId(int mainTaskId) { return(_subTaskRepository.FindByMainProjectId(mainTaskId)); }