public bool DeleteCategory(int mainCategoryId)
 {
     CategoryEntity mainCategory = new CategoryEntity(mainCategoryId);
     foreach (CategoryEntity item in mainCategory.Categories)
     {
         item.Delete();
     }
     return mainCategory.Delete();
 }
        public bool DeleteSubCategory(int subCategoryId)
        {
            CategoryEntity subCategory = new CategoryEntity(subCategoryId);

            return subCategory.Delete();
        }