Table of Contents

Class HttpResponseOptionsBuilder

Namespace
Trellis.Asp
Assembly
Trellis.Asp.dll

Non-generic builder used for Result (no value).

public sealed class HttpResponseOptionsBuilder
Inheritance
HttpResponseOptionsBuilder
Inherited Members
Extension Methods

Methods

Vary(params string[])

Appends unique headers to the standalone error response Vary header, preserving existing values.

public HttpResponseOptionsBuilder Vary(params string[] headers)

Parameters

headers string[]

Returns

HttpResponseOptionsBuilder

VaryForActor()

Appends the request header(s) that contribute to actor identity for the registered IActorProvider to the response Vary header. See VaryForActor() for the contract.

public HttpResponseOptionsBuilder VaryForActor()

Returns

HttpResponseOptionsBuilder

WithCacheControl(CacheControlHeaderValue)

Sets the Cache-Control response header from the supplied directive. The non-generic builder is consumed only by ToHttpResponse(Error, Action<HttpResponseOptionsBuilder>?), so this overload applies the directive to the standalone Error ProblemDetails response — useful for keeping deterministic-error responses out of intermediate caches via Error.ToHttpResponse(o => o.WithCacheControl(CacheControl.NoStore())). See WithCacheControl(CacheControlHeaderValue) for the generic builder's full success-and-failure semantics.

public HttpResponseOptionsBuilder WithCacheControl(CacheControlHeaderValue value)

Parameters

value CacheControlHeaderValue

Returns

HttpResponseOptionsBuilder

WithErrorMapping(Func<Error, int>)

Per-call override mapper for failure responses.

public HttpResponseOptionsBuilder WithErrorMapping(Func<Error, int> mapper)

Parameters

mapper Func<Error, int>

Returns

HttpResponseOptionsBuilder

WithErrorMapping<TError>(int)

Per-call override for a single error type.

public HttpResponseOptionsBuilder WithErrorMapping<TError>(int statusCode) where TError : Error

Parameters

statusCode int

Returns

HttpResponseOptionsBuilder

Type Parameters

TError

Exceptions

ArgumentOutOfRangeException

Thrown when statusCode is outside 100–599.