ComPawser.BFF 0.1.0-preview.3

This is a prerelease version of ComPawser.BFF.
dotnet add package ComPawser.BFF --version 0.1.0-preview.3
                    
NuGet\Install-Package ComPawser.BFF -Version 0.1.0-preview.3
                    
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="ComPawser.BFF" Version="0.1.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ComPawser.BFF" Version="0.1.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="ComPawser.BFF" />
                    
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 ComPawser.BFF --version 0.1.0-preview.3
                    
#r "nuget: ComPawser.BFF, 0.1.0-preview.3"
                    
#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 ComPawser.BFF@0.1.0-preview.3
                    
#: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=ComPawser.BFF&version=0.1.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=ComPawser.BFF&version=0.1.0-preview.3&prerelease
                    
Install as a Cake Tool

ComPawser

ComPawser is an opinionated ASP.NET Core framework for building Backend-for-Frontend (BFF) endpoints from small, independently discoverable response composers.

Install

dotnet add package ComPawser.BFF --prerelease

ComPawser supports .NET 8 and .NET 10.

Quick start

Register ComPawser using a marker type from the assembly containing your composers:

using ComPawser.BFF.Extensions;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddComPawserFramework<Program>();
var app = builder.Build();
app.UseComPawserFramework<Program>();
app.Run();

Create composers under a namespace matching *.Features.{FeatureName}.*:

using ComPawser.BFF.Abstractions;

namespace MyApi.Features.Account;

public sealed record AccountProfile(string Name, string Email) : ComPawserResponse;

public sealed class AccountProfileComPawser : AsyncFeatureComPawser<AccountProfile>
{
    public override Task<IDictionary<string, AccountProfile>> ComposeAsync(
        IComPawserContext context, CancellationToken cancellationToken = default)
    {
        IDictionary<string, AccountProfile> result = new Dictionary<string, AccountProfile>
        {
            ["profile"] = new("Ada", "ada@example.test")
        };
        return Task.FromResult(result);
    }
}

A request to /account discovers and executes composers in the Account feature. A synchronous composer can inherit from FeatureComPawser<T>.

Composition attributes

  • [Order(n)] groups execution into ordered stages. Composers in one stage may run in parallel.
  • [Lazy] excludes a composer from the normal response and exposes it through its segment.
  • [Active] includes a composer normally and permits direct execution through its segment.
  • [Header] and [Footer] place results in the corresponding response sections.
  • [Disabled] excludes a composer from discovery.
  • DependsOn and Dependents on lazy or active attributes describe dependencies.

Composers can exchange request-scoped values through IComPawserContext.Items. Avoid concurrent writes to the same key from composers with the same order.

Required convention

Feature discovery uses namespaces. The Features segment and following feature name are required, for example MyApi.Features.Account.AccountProfileComPawser.

MyApi
└── Features
    ├── Account
    ├── Header
    └── Footer

Build and validate locally

dotnet pack src/ComPawser.BFF/ComPawser.BFF.csproj --configuration Release --output artifacts
./eng/Test-Package.ps1

Versioning and license

ComPawser follows Semantic Versioning. Releases before 1.0.0 may change as the API is validated by real applications. ComPawser is licensed under the MIT License.

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 is compatible.  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.
  • net10.0

    • No dependencies.
  • 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
0.1.0-preview.3 76 8/5/2026