WHEN INSERTING  category.CategoryId = newCategory.CategoryId; // THIS IS DAMN IMPORTANT