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);
Here's a proper use of Int32.TryParse:
int? value; int dummy; if(Int32.TryParse(categoryID, out dummy)) { value = dummy; } else { value = null; } return value;