Struct Iri
- Namespace
- Xapi
- Assembly
- Xapi.Core.dll
An absolute Internationalized Resource Identifier (RFC 3987), such as an Activity id, a Verb id or an
extension key. Also used for IRLs (moreInfo, homePage, openid, fileUrl).
public readonly record struct Iri : IEquatable<Iri>
- Implements
- Inherited Members
Remarks
The original text is kept exactly and equality is ordinal string comparison (RFC 3987, 5.3.1), which is what IEEE 9274.1.1, 4.2.7 allows an LRS to use. Unlike Uri, nothing is normalized.
Constructors
Iri(string)
Creates an IRI.
public Iri(string value)
Parameters
valuestringAn absolute IRI: a scheme, a colon and a non-empty remainder.
Exceptions
- ArgumentNullException
valueis null.- FormatException
valueis not an absolute IRI.
Properties
IsEmpty
Whether this is the default struct value, which is not a valid IRI.
public bool IsEmpty { get; }
Property Value
Value
The IRI text exactly as given. Empty only for the default struct value.
public string Value { get; }
Property Value
Methods
FromUri(Uri)
Creates an IRI from an absolute Uri, using the text the URI was created from.
public static Iri FromUri(Uri uri)
Parameters
uriUriAn absolute URI.
Returns
- Iri
The IRI.
Exceptions
- FormatException
The URI is relative or not a valid IRI.
ToString()
Returns Value.
public override string ToString()
Returns
- string
The IRI text.
ToUri()
public Uri ToUri()
Returns
- Uri
The URI.
TryParse(string?, out Iri)
Tries to create an IRI.
public static bool TryParse(string? value, out Iri iri)