CategoryId is null

Hi,

I am trying to get a category through code. I have tried 2 different ways but i noticed that CategoryId in the databse is null which means I can not get the category by searching for the categoryId. is this normal? Shouldn’t categories have an Id?

Have tried these:

var rootCategories = _categoryService.GetChildCategories(Guid.Empty, Assortment.SystemId);
var rootCategory = rootCategories?.FirstOrDefault(c => c.Id?.Equals("Däck", 
                                          StringComparison.InvariantCultureIgnoreCase) ?? false);

and

_categoryService.Get("Däck")

Litium version: 7.2.0

1 Like

okej, have you solved this somehow? Any work around. In my case all categories will be created from BO. :confused:

In my case i could hard code the SystemId because it’s only 1 category and we are using it in a special way.

okey, thanks for your reply.

You can add the readable Id yourself to the DB through integration or by script in order to get this to work as you would like to.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.