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 IActionResult Delete(int id) { _subTaskRepo.Delete(id); return(NoContent()); }
public bool Delete(SubTask subtask) { return(_subTaskRepository.Delete(subtask) > 0); }