An open API service indexing awesome lists of open source software.

https://github.com/ricardotondello/functional.resulttype

Functional.ResultType is a C# library that provides a simple and lightweight Result type for handling functional programming concepts. It's designed to help you manage success and failure cases more elegantly, promoting better error handling and control flow in your applications.
https://github.com/ricardotondello/functional.resulttype

csharp dotnet dotnetcore extension result-type

Last synced: 10 months ago
JSON representation

Functional.ResultType is a C# library that provides a simple and lightweight Result type for handling functional programming concepts. It's designed to help you manage success and failure cases more elegantly, promoting better error handling and control flow in your applications.

Awesome Lists containing this project

README

          

# 📦 Functional.ResultType 🚀

[![Build](https://github.com/ricardotondello/Functional.ResultType/actions/workflows/dotnet.yml/badge.svg?branch=main)](https://github.com/ricardotondello/Functional.ResultType/actions/workflows/dotnet.yml)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=ricardotondello_Functional.ResultType&metric=alert_status)](https://sonarcloud.io/dashboard?id=ricardotondello_Functional.ResultType)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=ricardotondello_Functional.ResultType&metric=coverage)](https://sonarcloud.io/component_measures?id=ricardotondello_Functional.ResultType&metric=coverage)
[![NuGet latest version](https://badgen.net/nuget/v/Functional.ResultType/latest)](https://nuget.org/packages/Functional.ResultType)
[![NuGet downloads](https://img.shields.io/nuget/dt/Functional.ResultType)](https://www.nuget.org/packages/Functional.ResultType)

A lightweight Result type for functional programming in C#

## About

Functional.ResultType is a C# library that provides a simple and lightweight Result type for handling functional programming concepts.
It's designed to help you manage success and failure cases more elegantly, promoting better error handling and control flow in your applications.

## Features

- ✅ Simple and intuitive API for handling success and failure cases.
- ⚡️ Lightweight and dependency-free, making it easy to integrate into your project.
- 🧰 Helpful utilities for mapping, transforming, and composing results.
- 🛠️ Designed to enhance code readability and maintainability.

## Getting Started

To get started with Functional.ResultType, follow these steps:

1. **Installation**: You can install the package via NuGet Package Manager:
```shell
Install-Package Functional.ResultType

2. Usage: Import the namespace in your C# file and start using the Result type:

```csharp
public class FakeObject
{
public string Name { get; init; } = string.Empty;
}

var fakeObject FakeObject = new() { Name = "fake" };

var failureResult = Result.Fail(fakeObject);
var successResult = Result.Success(fakeObject);

//Chech the ResultExtensions.cs file for many more extensions methods.
```

## Contributing 👥

Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub.
If you would like to contribute code, please fork the repository and submit a pull request.

## License 📄

This project is licensed under the MIT License.
See [LICENSE](https://github.com/ricardotondello/Functional.ResultType/blob/main/LICENSE) for more information.

## Support ☕

Buy Me A Coffee