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);
How about this?
public int? ParseToNull(string categoryId) { int id; return int.TryParse(categoryId, out id) ? (int?)id : null; }