FlowSharp 1.0.0
Prefix Reserveddotnet add package FlowSharp --version 1.0.0
NuGet\Install-Package FlowSharp -Version 1.0.0
<PackageReference Include="FlowSharp" Version="1.0.0" />
<PackageVersion Include="FlowSharp" Version="1.0.0" />
<PackageReference Include="FlowSharp" />
paket add FlowSharp --version 1.0.0
#r "nuget: FlowSharp, 1.0.0"
#:package FlowSharp@1.0.0
#addin nuget:?package=FlowSharp&version=1.0.0
#tool nuget:?package=FlowSharp&version=1.0.0
FlowSharp
A lightweight, in-place pipeline framework for .NET 8 and later. FlowSharp provides both:
- A static helper (
PipelineBuilder.ExecuteAsync
) for building and running middleware pipelines without any dependency‐injection (DI) container. - A DI‐friendly implementation (
IPipelineBuilder<TContext, TResult>
→PipelineBuilder<TContext, TResult>
) that can be registered in anIServiceCollection
and used in ASP.NET Core or any other DI‐enabled host.
Table of Contents
Overview
FlowSharp is a minimal, open‐generic “pipeline” framework inspired by classic middleware concepts (similar to ASP.NET Core’s request pipeline) but designed to be entirely standalone. In its simplest form, FlowSharp lets you:
- Register an ordered list of “middleware” delegates or middleware classes
- Pass a
TContext
object and aCancellationToken
through all middleware - Eventually invoke a final “root action” that produces a
TResult
You can choose to use FlowSharp in two modes:
- Static mode (no DI required): call
PipelineBuilder.ExecuteAsync<TContext, TResult>(...)
directly anywhere. - DI mode (with DI container): register the open‐generic
IPipelineBuilder<,>
→PipelineBuilder<,>
mapping, then resolveIPipelineBuilder<MyContext, MyResult>
from your container, callUse(...)
for each middleware, and finally callExecuteAsync(context, ct)
.
Features
- Zero external dependencies (only uses .NET 8 built-in libraries).
- Open-generic DI registration: register
IPipelineBuilder<,>
once and it works for anyTContext, TResult
. - Inline middleware support: pass in a
Func<TContext, PipelineDelegate<TContext, TResult>, CancellationToken, Task<TResult>>
delegate without creating a full class. - Thread-safe building: once you begin execution, no further middleware can be registered.
- Seamless “root action” wiring: you specify your terminal handler (the final
TResult
producer) as part of your pipeline. - Easy unit‐testing: no container or special host is required; you can build a pipeline and immediately invoke it.
Prerequisites
- .NET 8 SDK or later
- Any IDE or editor that supports C# 10+ (Visual Studio 2022/2023, Rider, Visual Studio Code, etc.)
- (Optional, for DI mode) Any
IServiceCollection
‐compatible container (e.g., Microsoft.Extensions.DependencyInjection)
Installation
Clone the repository, add a reference to FlowSharp
, or create a NuGet package:
dotnet add package FlowSharp --version 1.0.0
Usage
Without DI (Static Helper)
var result = await PipelineBuilder.RunAsync(rootAction, context, middlewares[], CancellationToken);
With DI (Service Collection)
services.AddFlowSharp();
var pipeline = provider.GetRequiredService<IPipelineBuilder<MyContext, MyResult>>();
pipeline.Use(middleware1).Use(middleware2);
var flow = await pipeline.Build();
MyContext context = ...; // Create your context
MyResult result = await flow.Invoke(context, ct);
Project Structure
/src
└── FlowSharp
├── DependencyInjection.cs
├── IPipelineBuilder.cs
├── IMiddleware.cs
├── PipelineDelegate.cs
├── PipelineBuilder.cs
/tests
└── FlowSharp.Tests
/examples
└── ConsoleApp
Contributing
- Open issues for discussions.
- Fork and branch your work.
- Include tests for new features.
- Follow existing coding styles.
- Submit PRs clearly describing changes.
License
FlowSharp is licensed under the MIT License. See LICENSE for full 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
- Microsoft.Extensions.DependencyInjection (>= 9.0.5)
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 | 122 | 6/4/2025 |