FlowaX 1.0.1

dotnet add package FlowaX --version 1.0.1
                    
NuGet\Install-Package FlowaX -Version 1.0.1
                    
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="FlowaX" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FlowaX" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="FlowaX" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FlowaX --version 1.0.1
                    
#r "nuget: FlowaX, 1.0.1"
                    
#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.
#:package FlowaX@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FlowaX&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=FlowaX&version=1.0.1
                    
Install as a Cake Tool

FlowaX - Das funktionale Result-Framework für C#

<img src="https://github.com/pat2381/FlowaX/blob/master/Doc/Logo.png" width="80" height="80">

NuGet Version NuGet Downloads MIT License


🌟 Projektbeschreibung

FlowaX ist ein funktionales, leichtgewichtiges und erweiterbares Result-Framework für C#. Es bietet eine robuste Fehlerbehandlung, asynchrone Unterstützung und funktionale API-Erweiterungen wie Map, Bind, Match und vieles mehr.

Mit FlowaX kannst du Exceptions vermeiden, Ergebnisse sicher verwalten und Clean-Code-Prinzipien umsetzen. Entwickle zuverlässige und testbare Anwendungen mit einer klar strukturierten API.


🚀 Features

✔️ Polymorphes Design: Success<T> und Failure<T> für präzise Fehler- und Erfolgsverarbeitung
✔️ Funktionale Erweiterungen: Map, Bind, Match, OnSuccess, OnFailure
✔️ Asynchrone Unterstützung: BindAsync, MapAsync, FromAsync für Task<Result<T>>
✔️ Optionale Werte: Unterstützung für Maybe<T>
✔️ Automatisches Exception-Handling: Vermeide try-catch-Blöcke durch From-Methoden
✔️ Unit-Test-Unterstützung: Perfekt für xUnit, NUnit und MSTest


📦 Installation

.NET CLI:

dotnet add package FlowaX

oder

PM> Install-Package FlowaX

📚 Verwendungsbeispiele

1. Einfacher Erfolg und Fehler:

using FlowaX.Core;

var success = Result<int>.Success(42);
var failure = Result<int>.Failure("Ein Fehler ist aufgetreten.");

Console.WriteLine(success.IsSuccess);  // True
Console.WriteLine(failure.Error);     // "Ein Fehler ist aufgetreten"

2. Funktionale Verarbeitung:

using FlowaX.Core;
using FlowaX.Extensions;

var result = Result<int>.Success(10)
    .Map(x => x * 2)          // Verdopple den Wert
    .Bind(x => Result<int>.Success(x + 5)) // Füge 5 hinzu
    .Match(
        onSuccess: value => $"Ergebnis: {value}",
        onFailure: error => $"Fehler: {error}"
    );

Console.WriteLine(result);  // "Ergebnis: 25"

3. Asynchrone Verarbeitung:

using FlowaX.Core;

Result<int> result = Result<int>.From(() =>
{
    // Simulierte Operation mit Fehler
    if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
    {
        throw new InvalidOperationException("Keine Operation an Sonntagen!");
    }
    return 100;
});

Console.WriteLine(result.IsSuccess ? $"Ergebnis: {result.Value}" : $"Fehler: {result.Error}");

🌍 Lizenz

Dieses Projekt steht unter der MIT-Lizenz. Siehe LICENSE für Details.

Product 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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

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.1 170 12/11/2024
1.0.0 165 12/10/2024