is there some way of return null if it can\'t parse a string to int?
with:
public .... , string? categoryID) { int.TryParse(categoryID, out categoryID);
Simplest and one-liner...
int N = int.TryParse(somestring, out N) ? N : 0;
It works 'cause it's evaluated left to right. Null not so easy.