mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-22 01:26:20 +08:00
7626d82aa1
* 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>