Resulver 2.0.0
dotnet add package Resulver --version 2.0.0
NuGet\Install-Package Resulver -Version 2.0.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="Resulver" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Resulver --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Resulver, 2.0.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 Resulver as a Cake Addin #addin nuget:?package=Resulver&version=2.0.0 // Install Resulver as a Cake Tool #tool nuget:?package=Resulver&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Table of content
Installation
dotnet add package Resulver
Usage
public Result<int> Sum(int a, int b)
{
var sum = a + b;
return new Result<int>(sum);
}
public void Writer()
{
var result = Sum(3, 5);
Console.WriteLine(result.Content);
}
Result Message
public Result<User> AddUser(User user)
{
// implementation
return new Result<User>(user, message: "User Created");
}
public void Writer()
{
var user = new User();
var result = AddUser(user);
Console.WriteLine(result.Message);
}
Result Errors
public class UserNotFoundError() : ResultError(message: "User not found");
public class UserIdIsNotValidError() : ResultError(message: "User ID is not valid");
public Result RemoveUser(int userId)
{
//Implementation
return new UserNotFoundError();
//or for multiple errors
return new Result(new UserNotFoundError(), new UserIdIsNotValidError());
}
public void Writer()
{
var result = RemoveUser(1);
if (result.IsFailure)
{
foreach (var error in result.Errors)
{
Console.WriteLine(error.Message);
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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.
-
net8.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Resulver:
Package | Downloads |
---|---|
Valobtify
A package for implementing the 'Value Object' pattern. |
|
Resulver.AspNetCore.WebApi
Clean implementation of Result Pattern and error handling for Asp Core Web API applications |
|
Resulver.AspNetCore.Core
this is core of Resulver.AspNetCore packages |
|
Valobtify.AspNetCore.WebApi
A package for handling value objects in ASP.NET Core Web API with automatic mapping and Swagger integration for easy API documentation. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.0 | 138 | 11/6/2024 |
1.2.5 | 229 | 10/3/2024 |
1.2.4 | 158 | 8/20/2024 |
1.2.3 | 106 | 8/20/2024 |
1.2.2 | 110 | 8/19/2024 |
1.2.1 | 101 | 7/13/2024 |
1.2.0 | 96 | 7/13/2024 |
1.1.7 | 115 | 6/28/2024 |
1.1.6 | 112 | 6/13/2024 |
1.1.5 | 99 | 6/12/2024 |
1.1.4 | 108 | 6/12/2024 |
1.1.3 | 111 | 6/11/2024 |
1.1.2 | 93 | 6/11/2024 |
1.1.1 | 95 | 6/11/2024 |
1.1.0 | 89 | 6/11/2024 |
1.0.6 | 91 | 6/10/2024 |
1.0.5 | 143 | 5/17/2024 |
1.0.4 | 164 | 5/17/2024 |
1.0.3 | 125 | 5/17/2024 |
1.0.2 | 128 | 5/17/2024 |
1.0.1 | 115 | 5/16/2024 |
1.0.0 | 149 | 5/4/2024 |