FlowaX 1.0.1
dotnet add package FlowaX --version 1.0.1
NuGet\Install-Package FlowaX -Version 1.0.1
<PackageReference Include="FlowaX" Version="1.0.1" />
<PackageVersion Include="FlowaX" Version="1.0.1" />
<PackageReference Include="FlowaX" />
paket add FlowaX --version 1.0.1
#r "nuget: FlowaX, 1.0.1"
#:package FlowaX@1.0.1
#addin nuget:?package=FlowaX&version=1.0.1
#tool nuget:?package=FlowaX&version=1.0.1
FlowaX - Das funktionale Result-Framework für C#
<img src="https://github.com/pat2381/FlowaX/blob/master/Doc/Logo.png" width="80" height="80">
🌟 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 | 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. 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. |
-
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.