Open sandboxFocus

Method ToSerializableId

ToSerializableId()

Gets a string-based identifier that uniquely identifies the current declaration within a compilation.

Declaration
SerializableDeclarationId ToSerializableId()
Returns
Type Description
SerializableDeclarationId

A serializable declaration identifier.

Remarks

Unlike ToRef(), which returns a strongly-typed reference object, this method returns a lightweight string-based identifier that can be persisted to disk or transmitted across processes. The identifier is guaranteed to be resolvable in a different process, even with a different version of Metalama.

Use Resolve(ICompilation) or GetDeclarationFromId(SerializableDeclarationId) to resolve the identifier back to a declaration.

See Also