I've been trying to add a new category by using the following block of code:
CategoryInfo category = new CategoryInfo()
{
CategoryID = 999, // manually set
CategoryName = "TestCategory",
CategoryDisplayName = "Test Category",
CategoryEnabled = true,
CategorySiteID = 1
};
CategoryInfoProvider.SetCategoryInfo(category);
This doesn't throw any errors but it doesn't add the new category to
CMS_Category table.
However, if I removed this line: CategoryID = 999,, the category gets saved into the system and the CategoryID is automatically assigned.
I would like to set this field manually. Any help is appreciated.
(I am trying to avoid creating additional fields to handle this)