Class LinksExternalIds
- Namespace
- Foundation.Data.Doublets.Cli
- Assembly
- Foundation.Data.Doublets.Cli.dll
The ids other systems give our links, stored as links (issue #149): a
UUID of a service, an ObjectId of a document database, a URL, bound to
a link of ours and back, so the code that talks to the other system never
keeps a table of its own. The Rust counterpart is
link_cli::LinksExternalIds; in JavaScript a RemapLinks
reads the links under such ids directly.
public sealed class LinksExternalIds
- Inheritance
-
LinksExternalIds
- Inherited Members
Remarks
The ids of one kind share a scheme, such as uuid. The point named
ExternalId is E, the scheme is the link (S: E S) named
after it, and a link l bound to the id x has a pair
(p: S l) named scheme:x, so a link has one id of a scheme and
an id one link. No link of the table but a pair starts at S, so a
pair is never a link of the table itself, whatever address l has.
The table lives in the data or in a store of its own, as the rules of
permissions and the tokens of LinksTokenTable do; in a store
of its own every address it holds but its own is an address of the data.
Constructors
LinksExternalIds(INamedTypesLinks<uint>, string)
public LinksExternalIds(INamedTypesLinks<uint> store, string scheme = "id")
Parameters
storeINamedTypesLinks<uint>The store of the table: the data or a store of its own.
schemestringThe kind of the ids, such as
uuid.
Fields
ExternalIdName
The name of the point every scheme starts from.
public const string ExternalIdName = "ExternalId"
Field Value
Properties
Scheme
The kind of the ids.
public string Scheme { get; }
Property Value
Methods
Bind(string, uint)
Binds id to link, instead of any link it had and of any id the link had.
public uint Bind(string id, uint link)
Parameters
Returns
- uint
The pair that binds them.
Ensure(string, ILinks<uint>)
The link id is bound to, a new point (l: l l) of data bound to it when it has none.
public uint Ensure(string id, ILinks<uint> data)
Parameters
Returns
Find(string)
The link id is bound to, null when it is bound to none.
public uint? Find(string id)
Parameters
idstring
Returns
- uint?
IdOf(uint)
The id link is bound to, null when it has none.
public string? IdOf(uint link)
Parameters
linkuint
Returns
NameOf(string)
The name of the pair of id.
public string NameOf(string id)
Parameters
idstring
Returns
Unbind(string)
Unbinds id; whether it was bound.
public bool Unbind(string id)
Parameters
idstring