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:

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:

csharp
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:

  • ArgumentExceptionname is null or empty.

  • NotSupportedExceptionT has no XDM representation, or is Object. Object is rejected even though XdmValue.From``1 accepts it (by dispatching on the value's runtime type) — a MetadataProperty`1 exists to give call sites a concrete, checked type, and MetadataProperty<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.