Table of Contents

Class RepresentationMetadata

Namespace
Trellis
Assembly
Trellis.Results.dll

Carries HTTP representation metadata (RFC 9110 ยง8) through Trellis response mappers. Used to emit ETag, Last-Modified, Vary, Content-Language, Content-Location, and Accept-Ranges response headers consistently across MVC and Minimal API responses (200, 201, 206, 304).

public sealed class RepresentationMetadata
Inheritance
RepresentationMetadata
Inherited Members
Extension Methods

Properties

AcceptRanges

Gets the Accept-Ranges value (e.g., "bytes" or "none").

public string? AcceptRanges { get; }

Property Value

string

ContentLanguage

Gets the Content-Language values for the selected representation.

public IReadOnlyList<string>? ContentLanguage { get; }

Property Value

IReadOnlyList<string>

ContentLocation

Gets the Content-Location URI for the selected representation.

public string? ContentLocation { get; }

Property Value

string

ETag

Gets the entity tag validator for the selected representation.

public EntityTagValue? ETag { get; }

Property Value

EntityTagValue

LastModified

Gets the last modification date of the selected representation.

public DateTimeOffset? LastModified { get; }

Property Value

DateTimeOffset?

Vary

Gets the Vary header field names indicating which request fields influenced selection.

public IReadOnlyList<string>? Vary { get; }

Property Value

IReadOnlyList<string>

Methods

Create()

public static RepresentationMetadata.Builder Create()

Returns

RepresentationMetadata.Builder

WithETag(EntityTagValue)

Creates metadata with just an ETag.

public static RepresentationMetadata WithETag(EntityTagValue eTag)

Parameters

eTag EntityTagValue

The entity tag value.

Returns

RepresentationMetadata

A new RepresentationMetadata containing only the specified ETag.

WithStrongETag(string)

Creates metadata with just a strong ETag from an opaque tag string.

public static RepresentationMetadata WithStrongETag(string opaqueTag)

Parameters

opaqueTag string

The opaque tag string for a strong entity tag.

Returns

RepresentationMetadata

A new RepresentationMetadata containing only a strong ETag.