This code path leaves entire classes of unhandled parse exceptions on the table. I have a hard time believing this could be intentional. The safest and most concise approach is to use int.TryParse on the inputId and throw if it returns false.
Does it? Int.Parse says it can only return those 2 exceptions or ArgumentNullException, but nulls have been handled already.
https://learn.microsoft.com/en-us/dotnet/api/system.int32.pa...
Does it? Int.Parse says it can only return those 2 exceptions or ArgumentNullException, but nulls have been handled already.
https://learn.microsoft.com/en-us/dotnet/api/system.int32.pa...