private void AddToDict(Guid segmentId, IUtilityGraphSegmentRef newUtilityGraphSegmentRef) { if (!_graphElementsById.TryAdd(segmentId, newUtilityGraphSegmentRef)) { throw new ArgumentException($"A span segment with id: {segmentId} already exists in the graph."); } }
private void UpdateDict(Guid segmentId, IUtilityGraphSegmentRef newUtilityGraphSegmentRef) { RemoveFromDict(segmentId); AddToDict(segmentId, newUtilityGraphSegmentRef); }