FastEndpoints 1.0.0-beta2

Prefix Reserved
This is a prerelease version of FastEndpoints.
There is a newer version of this package available.
See the version list below for details.
dotnet add package FastEndpoints --version 1.0.0-beta2
                    
NuGet\Install-Package FastEndpoints -Version 1.0.0-beta2
                    
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="FastEndpoints" Version="1.0.0-beta2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FastEndpoints" Version="1.0.0-beta2" />
                    
Directory.Packages.props
<PackageReference Include="FastEndpoints" />
                    
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 FastEndpoints --version 1.0.0-beta2
                    
#r "nuget: FastEndpoints, 1.0.0-beta2"
                    
#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 FastEndpoints@1.0.0-beta2
                    
#: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=FastEndpoints&version=1.0.0-beta2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FastEndpoints&version=1.0.0-beta2&prerelease
                    
Install as a Cake Tool

FastEndpoints

An easy to use Web API framework (which encourages CQRS and Vertical Slice Architecture) built as an extension to the Asp.Net pipeline. FastEndpoints is 2X faster; uses only half the memory; and outperforms a traditional MVC controller by about 39,0000 requests per second on a typical desktop computer. It is a great alternative to the new minimal APIs that require manual endpoint mapping.

Try it out...

install from nuget: Install-Package FastEndpoints (currently beta)

note: the minimum required sdk version is .net 6.0 (preview at the moment)

Code Sample:

Program.cs

using FastEndpoints;

var builder = WebApplication.CreateBuilder();
builder.Services.AddFastEndpoints();
builder.Services.AddAuthenticationJWTBearer("SecretKey");

var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.UseFastEndpoints();
app.Run();

Request DTO

public class MyRequest : IRequest
{
    [From(Claim.UserName)]
    public string UserName { get; set; }  //this value will be auto populated from the user claim

    public int Id { get; set; }
    public string? Name { get; set; }
    public int Price { get; set; }
}

Response DTO

public class Response : IResponse
{
    public string? Name { get; internal set; }
    public int Price { get; set; }
    public string? Message { get; set; }
}

Endpoint Definition

public class MyEndpoint : Endpoint<MyRequest>
{
    public ILogger<MyEndpoint>? Logger { get; set; } //automatically injected from services

    public MyEndpoint()
    {
        //no longer hindered by attribute limitations
        Routes("/api/test/{id}");
        Verbs(Http.POST, Http.PATCH);
        Roles("Admin", "Manager");
        Policies("ManagementTeamCanAccess", "AuditorsCanAccess");
        Permissions(
            Allow.Inventory_Create_Item,
            Allow.Inventory_Retrieve_Item,
            Allow.Inventory_Update_Item); //declarative permission based authentication
    }

    protected override async Task ExecuteAsync(MyRequest req, CancellationToken ct)
    {
        //can do further validation here in addition to FluentValidations rules
        if (req.Price < 100)
            AddError(r => r.Price, "Price is too low!");

        AddError("This is a general error!");

        ThrowIfAnyErrors(); //breaks the flow and sends a 400 error response containing error details.

        Logger.LogInformation("this is your first endpoint!"); //dependency injected logger

        var isProduction = Env.IsProduction(); //read environment
        var smtpServer = Config["SMTP:HostName"]; //read configuration

        var res = new MyResponse //typed response to make integration tests convenient
        {
            Message = $"the route parameter value is: {req.Id}",
            Name = req.Name,
            Price = req.Price
        };

        await SendAsync(res);
    }
}

that's mostly it. all of your Endpoint definitions are automatically discovered on app startup and routes automatically mapped.

Documentation

proper documentation will be available within a few weeks once v1.0 is released. in the meantime have a browse through the Web, Test and Benchmark projects to see more examples.

Benchmark results

Bombardier load test

FastEndpoints (39,500 requests more per second than mvc controller)

Statistics        Avg      Stdev        Max
  Reqs/sec    110569.18    4482.43  124218.28
  Latency        0.90ms    50.54us    16.00ms
  HTTP codes:
    1xx - 0, 2xx - 1105885, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:    55.47MB/s

AspNet MapControllers

Statistics        Avg      Stdev        Max
  Reqs/sec     71621.34    3551.21  100210.44
  Latency        1.39ms   186.22us    42.00ms
  HTTP codes:
    1xx - 0, 2xx - 716949, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:    35.95MB/s

AspNet MVC Controller

Statistics        Avg      Stdev        Max
  Reqs/sec     70981.56    2983.29   78947.63
  Latency        1.40ms   118.66us    27.00ms
  HTTP codes:
    1xx - 0, 2xx - 710040, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:    35.48MB/s

parameters used: -c 100 -m POST -f "body.json" -H "Content-Type:application/json" -d 10s http://localhost:5000/Home/Index/123

BenchmarkDotNet head-to-head results

Method Mean Error StdDev Ratio RatioSD Gen 0 Gen 1 Allocated
FastEndpointsEndpoint 75.30 μs 1.252 μs 1.171 μs 1.00 0.00 2.4414 - 21 KB
AspNetMapControllers 144.44 μs 2.778 μs 3.307 μs 1.92 0.04 5.3711 0.2441 44 KB
AspNetMVCController 148.82 μs 2.110 μs 1.974 μs 1.98 0.04 5.3711 - 45 KB
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 (135)

Showing the top 5 NuGet packages that depend on FastEndpoints:

Package Downloads
FastEndpoints.Swagger

Swagger support for FastEndpoints.

FastEndpoints.Security

Security library for FastEndpoints.

Elsa.Api.Common

Provides common features to modules that expose API endpoints.

Elsa.JavaScript

Provides a JavaScript expression provider.

Elsa.EntityFrameworkCore

Provides Entity Framework Core implementations of various abstractions from various modules.

GitHub repositories (20)

Showing the top 20 popular GitHub repositories that depend on FastEndpoints:

Repository Stars
ardalis/CleanArchitecture
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
elsa-workflows/elsa-core
The Workflow Engine for .NET
RRQM/TouchSocket
TouchSocket is an integrated .NET networking framework that includes modules for socket, TCP, UDP, SSL, named pipes, HTTP, WebSocket, RPC, and more. It offers a one-stop solution for TCP packet issues and enables quick implementation of custom data message parsing using protocol templates.
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
Elfocrash/clean-minimal-api
A project showcasing how you can build a clean Minimal API using FastEndpoints
Reaparr/Reaparr
Plex downloader that brings content from any server to yours!
NimblePros/eShopOnWeb
Sample ASP.NET Core 10.0 reference application, powered by Microsoft, demonstrating a domain-centric application architecture with monolithic deployment model.
CircumSpector/DS4Windows
A reimagination of DS4Windows.
netcorepal/netcorepal-cloud-framework
一个基于ASP.NET Core实现的整洁领域驱动设计落地战术框架。 A tactical framework for Clean Domain-Driven Design based on ASP.NET Core.
ikyriak/IdempotentAPI
A .NET library that handles the HTTP write operations (POST and PATCH) that can affect only once for the given request data and idempotency-key by using an ASP.NET Core attribute (filter).
Elfocrash/aws-videos
dj-nitehawk/MongoWebApiStarter
A full-featured starter template for `dotnet new` to quickly scaffold an Asp.Net 8 Web-Api project with MongoDB as the data store.
ardalis/modulith
Modulith is a dotnet new template for Modular Monoliths. It streamlines the creation of new .Net solutions and the addition of modules to existing ones.
ardalis/WebApiBestPractices
Resources related to my Pluralsight course on this topic.
leosperry/ha-kafka-net
Integration that uses Home Assistant Kafka integration for creating home automations in .NET and C#
bingbing-gui/dotnet-platform
这是一个围绕 新一代 .NET 应用模型 的实践型仓库,覆盖 Web、云原生、AI、微服务等多种应用形态。
dj-nitehawk/MiniDevTo
Source code of the Dev.To article "Building REST APIs In .Net 8 The Easy Way!"
Hona/VerticalSliceArchitecture
Spend less time over-engineering, and more time coding. The template has a focus on convenience, and developer confidence. Vertical Slice Architecture 🎈
dr-marek-jaskula/DomainDrivenDesignUniversity
This project was made for tutorial purpose - to clearly present the domain driven design concept.
dj-nitehawk/Hybrid-Inverter-Monitor
Monitoring application for hybrid inverters using the Voltronic communication protocol & JK BMS via USB port.
Version Downloads Last Updated
8.0.0-beta.9 81 2/11/2026
8.0.0-beta.8 42 2/11/2026
8.0.0-beta.7 39 2/11/2026
8.0.0-beta.6 43 2/11/2026
8.0.0-beta.5 49 2/10/2026
8.0.0-beta.4 56 2/10/2026
8.0.0-beta.3 58 2/10/2026
8.0.0-beta.2 264 2/5/2026
8.0.0-beta.1 61 2/5/2026
7.3.0-beta.14 72 2/4/2026
7.3.0-beta.13 48 2/4/2026
7.3.0-beta.12 88 2/3/2026
7.3.0-beta.11 135 2/1/2026
7.3.0-beta.10 70 1/31/2026
7.3.0-beta.9 139 1/29/2026
7.3.0-beta.8 68 1/27/2026
7.3.0-beta.7 149 1/26/2026
7.3.0-beta.6 174 1/21/2026
7.2.0 98,612 1/13/2026
1.0.0-beta2 843 9/25/2021
Loading failed

WARNING: this is a beta release. do not use in production!