TopicCollection.TryGetById Method

Namespace
Kampute.DocToolkit.Collections
Assembly
  • Kampute.DocToolkit.dll

Definition

Attempts to find a topic in the topic hierarchy by its qualified identifier.
public bool TryGetById(string id, [NotNullWhen(true)] out TopicModel topic)

Parameters

id string
The qualified identifier of the topic to lookup.
topic TopicModel
When this method returns, contains the topic if found; otherwise, null.

Returns

bool
true if the topic was found; otherwise, false.

Exceptions

ArgumentNullException
Thrown when id is null.

Remarks

This method performs a case-insensitive lookup for a topic by its identifier in constant time O(1).

The identifier must be fully qualified, which means it should include the identifier of all parent topics in the hierarchy separated by slashes ('/').