PutridParrot.Results 1.0.0-alpha

This is a prerelease version of PutridParrot.Results.
dotnet add package PutridParrot.Results --version 1.0.0-alpha
NuGet\Install-Package PutridParrot.Results -Version 1.0.0-alpha
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="PutridParrot.Results" Version="1.0.0-alpha" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PutridParrot.Results --version 1.0.0-alpha
#r "nuget: PutridParrot.Results, 1.0.0-alpha"
#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 PutridParrot.Results as a Cake Addin
#addin nuget:?package=PutridParrot.Results&version=1.0.0-alpha&prerelease

// Install PutridParrot.Results as a Cake Tool
#tool nuget:?package=PutridParrot.Results&version=1.0.0-alpha&prerelease

PutridParrot.Results

Build PutridParrot.Results NuGet version (PutridParrot.Results) GitHub license GitHub Releases GitHub Issues

Note: This is a total re-write of the Results code-base to simplify everything.

There are several ways to return a result and/or error code from a method/function. For example, we might return an integer value, if the value is negative it represents an error. We might return an integer error code (such as some of the Windows API functions do) and the actual return value is returned via out parameters or similar. Or we return something like a tuple with a value to indicate the error or success along with a returned value.

The IResult is an interface for implementing a better tuple version of this, in that we will return a Success or Failure object and we can using type pattern matching to determine whether the return is a success or failure and then access a return value accordingly.

IResult<string> DoSomething()
{
    // do some stuff

    // if failed, return a failure with a failure message
    // return Result.Failure("Failed");


    // if succeeded, with result value (a string in this case)
    return Result.Success("Completed");
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 is compatible.  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 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net7.0

    • No dependencies.

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
1.0.0-alpha 164 11/22/2023