ComPawser.BFF
0.1.0-preview.3
dotnet add package ComPawser.BFF --version 0.1.0-preview.3
NuGet\Install-Package ComPawser.BFF -Version 0.1.0-preview.3
<PackageReference Include="ComPawser.BFF" Version="0.1.0-preview.3" />
<PackageVersion Include="ComPawser.BFF" Version="0.1.0-preview.3" />
<PackageReference Include="ComPawser.BFF" />
paket add ComPawser.BFF --version 0.1.0-preview.3
#r "nuget: ComPawser.BFF, 0.1.0-preview.3"
#:package ComPawser.BFF@0.1.0-preview.3
#addin nuget:?package=ComPawser.BFF&version=0.1.0-preview.3&prerelease
#tool nuget:?package=ComPawser.BFF&version=0.1.0-preview.3&prerelease
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.DependsOnandDependentson 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 | 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 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. |
-
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 |