Commit 7626d82
Add TryParse methods to NodeId and ExpandedNodeId (#3302)
* Initial plan
* Add TryParse methods to NodeId and ExpandedNodeId with comprehensive tests
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
* Address code review feedback: use explicit Exception catch and improve consistency
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
* Refactor TryParse to be core implementation, Parse now calls TryParse
Changed architecture so TryParse contains the parsing logic without throwing exceptions.
Parse methods now call TryParse and throw appropriate exceptions on failure.
This avoids using try-catch for control flow as requested.
All 1643 BuiltInType tests pass.
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
* Refactor ExpandedNodeId InternalTryParse to avoid creating object in try-catch
Reworked the static InternalTryParse method to directly parse ExpandedNodeId
components without creating an ExpandedNodeId object and catching exceptions.
Also refactored the instance InternalParse method to use a new InternalTryParseInstance
helper that implements TryParse pattern, with InternalParse calling it and throwing
appropriate exceptions (ArgumentException or ServiceResultException) on failure.
All 1643 BuiltInType tests pass.
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>1 parent ef7bbd7 commit 7626d82
File tree
3 files changed
+717
-186
lines changed- Stack/Opc.Ua.Core/Types/BuiltIn
- Tests/Opc.Ua.Core.Tests/Types/BuiltIn
3 files changed
+717
-186
lines changed
0 commit comments