FlowSharp 1.0.0

Prefix Reserved
dotnet add package FlowSharp --version 1.0.0
                    
NuGet\Install-Package FlowSharp -Version 1.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="FlowSharp" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FlowSharp" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="FlowSharp" />
                    
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 FlowSharp --version 1.0.0
                    
#r "nuget: FlowSharp, 1.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.
#:package FlowSharp@1.0.0
                    
#: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=FlowSharp&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=FlowSharp&version=1.0.0
                    
Install as a Cake Tool

FlowSharp

A lightweight, in-place pipeline framework for .NET 8 and later. FlowSharp provides both:

  1. A static helper (PipelineBuilder.ExecuteAsync) for building and running middleware pipelines without any dependency‐injection (DI) container.
  2. A DI‐friendly implementation (IPipelineBuilder<TContext, TResult>PipelineBuilder<TContext, TResult>) that can be registered in an IServiceCollection and used in ASP.NET Core or any other DI‐enabled host.

Table of Contents

  1. Overview

  2. Features

  3. Prerequisites

  4. Installation

  5. Usage

  6. Project Structure

  7. Contributing

  8. License


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 a CancellationToken through all middleware
  • Eventually invoke a final “root action” that produces a TResult

You can choose to use FlowSharp in two modes:

  1. Static mode (no DI required): call PipelineBuilder.ExecuteAsync<TContext, TResult>(...) directly anywhere.
  2. DI mode (with DI container): register the open‐generic IPipelineBuilder<,>PipelineBuilder<,> mapping, then resolve IPipelineBuilder<MyContext, MyResult> from your container, call Use(...) for each middleware, and finally call ExecuteAsync(context, ct).

Features

  • Zero external dependencies (only uses .NET 8 built-in libraries).
  • Open-generic DI registration: register IPipelineBuilder<,> once and it works for any TContext, 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 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.

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