Improve handling of stored procedure return value type

Check if return value is already a long before parsing its
string representation. This enhances robustness and efficiency
when the value is of the correct type.
This commit is contained in:
2026-01-12 15:48:03 +01:00
parent 7bfb56b664
commit af6f94c1ed

View File

@@ -156,7 +156,9 @@ public class InsertObjectProcedureHandler(IRepository repo) : IRequestHandler<In
var guidParam = parameters.Last();
if (guidParam.Value != DBNull.Value)
if (long.TryParse(guidParam.Value.ToString(), out var guid))
if (guidParam.Value is long longValue)
return longValue;
else if (long.TryParse(guidParam.Value.ToString(), out var guid))
return guid;
return 0;