StructuredMinimalApi
The goal of this project it's to show how to use MinimalApi.Endpoint package. It demontrate how to configure API endpoints as individual classes based on minimal Api (.Net 6)
Install / Use
/learn @michelcedric/StructuredMinimalApiREADME
StructuredMinimalApi
The goal of this project it's to show how to use MinimalApi.Endpoint package.
It demontrate how to configure API endpoints as individual classes based on minimal Api (.Net 6)
Program.cs
Use AddEndpoints extenion method to create each endpoint.
And also MapEndpoint extension method to use new routing APIs
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpoints();
var app = builder.Build();
app.MapEndpoints();
app.Run();
Define an endpoint
To create and define one endpoint, it needs to implement IEndpoint interface
public class GetWithParamEndpoint : IEndpoint<string, string>
{
public void AddRoute(IEndpointRouteBuilder app)
{
app.MapGet("/Todo/2/{param1}", (string param1) => HandleAsync(param1));
}
public Task<string> HandleAsync(string request)
{
return Task.FromResult($"Hello World! 2 {request}");
}
}
Projects Using MinimalApi.Endpoint
-
eShopOnWeb: Sample ASP.NET Core reference application, powered by Microsoft
- Use in PublicApi project: This project demonstrates how to configure endpoints as individual classes
-
EshopOnVue.js: Same as EshopOnWeb project in Vue.js
-
StructuredMinimalApi: Sample project to show some usage
-
WebApiBestPractices: Resources related to Ardalis Pluralsight course on this topic.
- Pluralsight : ASP.NET Core 6 Web API: Best Practices: Organizing Minimal API demo and best practices.
Nuget Package
A nuget package is available here.
Related Skills
gh-issues
351.2kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
351.2kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
taskflow-inbox-triage
351.2kname: taskflow-inbox-triage description: Example TaskFlow authoring pattern for inbox triage. Use when messages need different treatment based on intent, with some routes notifying immediately, some w
