GitHub - dj-nitehawk/FastEndpoints: A developer friendly web api framework for Asp.Net which encourages CQRS and Vertical Slice Architecture.

github.com
2 min read
standard
A developer friendly web api framework for Asp.Net which encourages CQRS and Vertical Slice Architecture. - GitHub - dj-nitehawk/FastEndpoints: A developer friendly web api framework for Asp.Net wh...
FastEndpoints

An easy to use Web-Api framework (which encourages CQRS and Vertical Slice Architecture) built as an extension to the Asp.Net pipeline. Performance is on par with .net 6 minimal apis and is 2X faster; uses only half the memory; and outperforms a traditional MVC controller by about 73k requests per second on a Ryzen 3700X desktop.

Try it out...

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

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

Code Sample:

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…
Read full article