Table of Contents

Class WriteOutcome

Namespace
Trellis
Assembly
Trellis.Http.Abstractions.dll

Factory helpers that build a WriteOutcome<T> case but return the base type, so call sites flow through generic pipelines (for example Result.Map / ToHttpResponse) without an explicit (WriteOutcome<T>) cast to widen the nested case. Mirrors the non-generic Result / generic Result<T> pairing.

public static class WriteOutcome
Inheritance
WriteOutcome
Inherited Members

Methods

AcceptedNoContent<T>(string?, RetryAfterValue?)

Builds the AcceptedNoContent case (HTTP 202), returned as the base WriteOutcome<T>. T must be specified explicitly.

public static WriteOutcome<T> AcceptedNoContent<T>(string? monitorUri = null, RetryAfterValue? retryAfter = null)

Parameters

monitorUri string

Optional address where progress can be polled.

retryAfter RetryAfterValue

Optional hint for when to poll next.

Returns

WriteOutcome<T>

The no-content accepted outcome typed as WriteOutcome<T>.

Type Parameters

T

The representation/body type the surrounding pipeline carries.

Accepted<T>(T, string?, RetryAfterValue?)

Builds the Accepted case (HTTP 202), returned as the base WriteOutcome<T>.

public static WriteOutcome<T> Accepted<T>(T statusBody, string? monitorUri = null, RetryAfterValue? retryAfter = null)

Parameters

statusBody T

A status body describing the in-flight operation.

monitorUri string

Optional address where progress can be polled.

retryAfter RetryAfterValue

Optional hint for when to poll next.

Returns

WriteOutcome<T>

The accepted outcome typed as WriteOutcome<T>.

Type Parameters

T

The status-body type.

Created<T>(T, string?, RepresentationMetadata?)

Builds the Created case (HTTP 201), returned as the base WriteOutcome<T>.

public static WriteOutcome<T> Created<T>(T value, string? location = null, RepresentationMetadata? metadata = null)

Parameters

value T

The created entity.

location string

Optional address of the newly created resource. Null, empty, or whitespace leaves Location generation to the HTTP boundary; without a boundary-supplied address, the header is omitted.

metadata RepresentationMetadata

Optional representation metadata (ETag, Last-Modified, …).

Returns

WriteOutcome<T>

The created outcome typed as WriteOutcome<T>.

Type Parameters

T

The representation/body type.

UpdatedNoContent<T>(RepresentationMetadata?)

Builds the UpdatedNoContent case (HTTP 204), returned as the base WriteOutcome<T>. T must be specified explicitly.

public static WriteOutcome<T> UpdatedNoContent<T>(RepresentationMetadata? metadata = null)

Parameters

metadata RepresentationMetadata

Optional representation metadata for the updated resource.

Returns

WriteOutcome<T>

The no-content updated outcome typed as WriteOutcome<T>.

Type Parameters

T

The representation/body type the surrounding pipeline carries.

Updated<T>(T, RepresentationMetadata?)

Builds the Updated case (HTTP 200), returned as the base WriteOutcome<T>.

public static WriteOutcome<T> Updated<T>(T value, RepresentationMetadata? metadata = null)

Parameters

value T

The updated entity.

metadata RepresentationMetadata

Optional representation metadata for the updated resource.

Returns

WriteOutcome<T>

The updated outcome typed as WriteOutcome<T>.

Type Parameters

T

The representation/body type.