HttpBuildR.ActionResult 3.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package HttpBuildR.ActionResult --version 3.1.0
NuGet\Install-Package HttpBuildR.ActionResult -Version 3.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HttpBuildR.ActionResult" Version="3.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add HttpBuildR.ActionResult --version 3.1.0
#r "nuget: HttpBuildR.ActionResult, 3.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install HttpBuildR.ActionResult as a Cake Addin
#addin nuget:?package=HttpBuildR.ActionResult&version=3.1.0

// Install HttpBuildR.ActionResult as a Cake Tool
#tool nuget:?package=HttpBuildR.ActionResult&version=3.1.0

HTTP BuildR ActionResult HTTP BuildR ActionResult

Nuget

Http BuildR ActionResult is a simple set of C# functions for building responses using ActionResult!

They are always typed (unlike the static action result builders in BaseController) and easy to build using the existing fluent API on-top HttpResponseMessage, with some added methods that make it easy on the happy and unhappy path.

Getting Started

To use this library, simply include HttpBuildR.ActionResult.dll in your project or grab it from NuGet, and add this to the top of each .cs file that needs it:

using HttpBuildR;
using Resp = HttpStatusCode;

Then get building!,

using HttpBuildR;

// its helpful to alias this for readability
using Resp = HttpStatusCode;

...
// all types can be converted to ok responses
ActionResult<string> result = ActionResultBuilder.Ok("some content");
// non-ok responses can be built from response status codes
ActionResult<string> result = Resp.BadRequest
                 .Result()
                  // add some headers
                 .WithHeader("x-custom-header", "a","b","c")
                  // with some content, they are all supported!
                 .WithProblemDetails(new ProblemDetails(){...})
                 // only typed action results are supported
                 .ToActionResult<string>();
...

For more details/information have a look the test project or create an issue.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.1.1 66 4/19/2024
3.1.0 96 4/13/2024
3.0.0 182 12/16/2023
2.0.0 107 10/1/2023
1.1.3 129 6/5/2023
1.1.2 149 4/25/2023
1.1.1 202 3/11/2023
1.1.0 214 2/4/2023