Documentation
Table of Contents

Struct DocumentId

Namespace
IntentSharp.Documents
Assembly
IntentSharp.dll

The path of a document in an IDocumentStore, relative to the store's root, with forward slashes. The constructor normalizes the path it is given, so two ids are equal exactly when their Path values are equal, compared ordinally (case-sensitive).

public readonly record struct DocumentId : IEquatable<DocumentId>
Implements
IEquatable<DocumentId>
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Extension Methods

Constructors

DocumentId(string)

Creates the id of the document at path. Backslashes become forward slashes, surrounding white space is trimmed, one leading / is removed and repeated slashes are collapsed, so "\rules\orders.yaml" and "rules//orders.yaml" both name "rules/orders.yaml".

Properties

Extension

The extension of Name, lower-cased and with its dot, for example ".yaml" for "orders.rules.YAML"; an empty string when the name has no extension. A document format is chosen by it.

Name

The last segment of Path, for example "orders.rules.yaml" for "rules/orders.rules.yaml".

Path

The normalized path: relative, forward slashes, no empty, . or .. segment, no segment that ends with a dot or a space or is a reserved device name, and no colon.

Methods

ToString()

Returns Path.