PhoenixmlDb.Core
MetadataProperty`1
A typed, discoverable handle on one metadata name in one namespace.
#MetadataProperty`1
Namespace: PhoenixmlDb.Core.Metadata
A typed, discoverable handle on one metadata name in one namespace.
Type parameters:
-
T— The CLR type of the value. Must be supported byXdmValue.From``1.
Declaring properties as static readonly fields on a vocabulary class gives call sites compile-time typing, rename refactoring, and IntelliSense discovery, and keeps namespace URIs out of the call site entirely:
public static class Routing
{
public static readonly MetadataProperty<string> Status = new(RoutingNs, "status");
}
await container.SetMetadataAsync(docId, Routing.Status, "pending");
string? status = await container.GetMetadataAsync(docId, Routing.Status);
#Constructors
##ctor(PhoenixmlDb.Core.NamespaceId,String)
Parameters:
-
namespace— The owning namespace. -
name— The local name. Must not be empty.
Exceptions:
-
ArgumentException—nameis null or empty. -
NotSupportedException—Thas no XDM representation, or isObject.Objectis rejected even thoughXdmValue.From``1accepts it (by dispatching on the value's runtime type) — aMetadataProperty`1exists to give call sites a concrete, checked type, andMetadataProperty<object>would defeat that by forcing every read back into an unchecked cast.
#Properties
| Name | Description |
|---|---|
Name
|
The local name, unqualified. |
Namespace
|
The namespace this metadata name belongs to. |
QName
|
The qualified name used as the storage and index key. |
#Methods
#FromXdm(PhoenixmlDb.Xdm.XdmValue)
Converts an XDM value back to this property's type.
#ToString
#ToXdm(`0)
Converts a value of this property's type to its XDM representation.