public void DeleteCategory(CategoryDO category) { List <TaskDO> tasks = taskDAO.ReadAllByCategoryId(category.CategoryId); if (tasks.Any(t => t.Status != TaskStatus.TaskComplete)) { throw new ValidationException("Category contains active tasks!"); } else { categoryDAO.Delete(category); } }
public void Delete(CATEGORY Category) { _categoryDAO.Delete(Category); Context.SaveChanges(); }