Table of Contents

Interface IRepresentationValidator<T>

Namespace
Trellis.Asp
Assembly
Trellis.Asp.dll

Strategy for generating representation-specific validators (ETags) that account for content negotiation variants per RFC 9110 §8.8.3.1/§8.8.3.3.

public interface IRepresentationValidator<in T>

Type Parameters

T

The domain type being represented.

Extension Methods

Remarks

The default Trellis behavior generates ETags from aggregate state only. When the same resource has multiple representations (different encodings, languages, media types, or projections), each variant needs a distinct ETag.

Implement this interface to combine domain version with variant metadata. Register as a service; Trellis response mappers will use it when available.

Methods

GenerateETag(T, string?)

Generates an EntityTagValue for the given value and representation variant.

EntityTagValue GenerateETag(T value, string? variantKey = null)

Parameters

value T

The domain value.

variantKey string

Optional variant key (e.g., encoding, language, projection ID).

Returns

EntityTagValue

The entity tag for this specific representation.