OSK Logo OSK.Hub

Outputs

Source: GitHub

Packages: NuGet

Summary

This library provides an implementation to the result pattern, using a semantic known as Output. The terminology in the library is aimed at responses from functions/methods in a project, but there are helpers and conversions for HTTP status codes over a network. The main goal is to provide easy access to a way to give more details about the output of a given function than merely true/false (out style parameters) or exception based error handling. Utilizing the result pattern, developers can provide richer data to applications when receiving error or success outputs.

Outputs come in few different ways: Output: a simple, single output for a function MultiOutput: a container of multiple outputs for a function PaginatedOutput: an output that represents a page of data for a list style response

Outputs are capable of masking as other types of outputs, to make bubbling error responses easier, and there are generic overloads to each.

The main accessor for generating outputs is the Out factory that provides quick access to generate various outputs of a known status code, or custom codes if required.

Outputs also can include diagnostic related data for runtime performance checking or similar validation.