This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tags = new List<KeyValuePair<string, object?>>() | |
{ | |
new KeyValuePair<string, object?>("tag1", "value1"), | |
new KeyValuePair<string, object?>("tag2", "value2"), | |
}; | |
ActivityLink link = new ActivityLink(default, new ActivityTagsCollection(tags)); | |
foreach (ref readonly KeyValuePair<string, object?> tag in link.EnumerateTagObjects()) | |
{ | |
// Consume the link tags without any extra allocations or value copying. | |
} | |
ActivityEvent e = new ActivityEvent("SomeEvent", tags: new ActivityTagsCollection(tags)); | |
foreach (ref readonly KeyValuePair<string, object?> tag in e.EnumerateTagObjects()) | |
{ | |
// Consume the event's tags without any extra allocations or value copying. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment