Class HttpResponseOptionsBuilder
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
headersstring[]
Returns
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
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
valueCacheControlHeaderValue
Returns
WithErrorMapping(Func<Error, int>)
Per-call override mapper for failure responses.
public HttpResponseOptionsBuilder WithErrorMapping(Func<Error, int> mapper)
Parameters
Returns
WithErrorMapping<TError>(int)
Per-call override for a single error type.
public HttpResponseOptionsBuilder WithErrorMapping<TError>(int statusCode) where TError : Error
Parameters
statusCodeint
Returns
Type Parameters
TError
Exceptions
- ArgumentOutOfRangeException
Thrown when
statusCodeis outside 100–599.