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
monitorUristringOptional address where progress can be polled.
retryAfterRetryAfterValueOptional hint for when to poll next.
Returns
- WriteOutcome<T>
The no-content accepted outcome typed as WriteOutcome<T>.
Type Parameters
TThe 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
statusBodyTA status body describing the in-flight operation.
monitorUristringOptional address where progress can be polled.
retryAfterRetryAfterValueOptional hint for when to poll next.
Returns
- WriteOutcome<T>
The accepted outcome typed as WriteOutcome<T>.
Type Parameters
TThe 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
valueTThe created entity.
locationstringOptional 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.
metadataRepresentationMetadataOptional representation metadata (ETag, Last-Modified, …).
Returns
- WriteOutcome<T>
The created outcome typed as WriteOutcome<T>.
Type Parameters
TThe 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
metadataRepresentationMetadataOptional representation metadata for the updated resource.
Returns
- WriteOutcome<T>
The no-content updated outcome typed as WriteOutcome<T>.
Type Parameters
TThe 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
valueTThe updated entity.
metadataRepresentationMetadataOptional representation metadata for the updated resource.
Returns
- WriteOutcome<T>
The updated outcome typed as WriteOutcome<T>.
Type Parameters
TThe representation/body type.