IDocumentExtensions Class
Namespace
Statiq.Common
Base Types
  • object
graph BT Type-->Base0["object"] Type["IDocumentExtensions"] class Type type-node

Syntax

public static class IDocumentExtensions

Methods

Name Return Value Summary
AsDynamic(IDocument) dynamic
Presents the metadata of a document as a dynamic object. Cast the return object to IDocument to convert it back to a document.
static
GetContentBytesAsync(IDocument) Task<byte[]>
Gets the content associated with this document as a byte array. This will result in reading the entire content stream. It's preferred to read directly as a stream using GetContentStream(IDocument) if possible.
static
GetContentStream(IDocument) Stream
Gets the content associated with this document as a Stream. The stream you get from this call must be disposed as soon as reading is complete.
static
GetContentStringAsync(IDocument) Task<string>
Gets the content associated with this document as a string. This will result in reading the entire content stream. It's preferred to read directly as a stream using GetContentStream(IDocument) if possible.
static
GetContentTextReader(IDocument) TextReader
Gets the content associated with this document as a TextReader. This is prefered over reading the stream as text since it might be optimized for text-based use cases. The TextReader you get from this call must be disposed as soon as reading is complete.
static
GetTitle(IDocument) string
Gets a normalized title derived from the document source (or Title if defined).
static
IdEquals(IDocument, IDocument) bool
Determines if a document is equal by comparing their IDs.
static
IdEquals<TDocument>(TDocument, TDocument) bool
Determines if a document is equal by comparing their IDs.
static
MediaTypeEquals(IDocument, string) bool
Determines if the supplied media type equals the media type of the content.
static