StringContent Class
A content provider for strings.
Namespace
Statiq.Common
Interfaces
Base Types
  • object
graph BT Type-->Base0["object"] Type-.->Interface0["IContentProvider"] click Interface0 "/api/Statiq.Common/IContentProvider" Type-.->Interface1["ICacheCode"] click Interface1 "/api/Statiq.Common/ICacheCode" Type["StringContent"] class Type type-node

Syntax

public class StringContent : IContentProvider, ICacheCode

Constructors

Properties

Name Property Type Summary
MediaType string
Gets the media type of the content.

Methods

Name Return Value Summary
CloneWithMediaType(string) IContentProvider
Clones the current content provider with a new media type.
GetCacheCodeAsync() Task<int>
Gets a deterministic hash appropriate for caching.
GetLength() long
Gets the length of the content in bytes.
GetStream() Stream
Gets the content stream. The returned stream should be disposed after use.
GetTextReader() TextReader
Gets an appropriate TextReader for the content. This is prefered over reading the stream as text since it might be optimized for text-based use cases. The returned TextReader should be disposed after use.

Extension Methods