SkillAgentSearch skills...

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/StructuredMinimalApi
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Build status Downloads

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

Nuget Package

A nuget package is available here.

Related Skills

View on GitHub
GitHub Stars88
CategoryDevelopment
Updated6mo ago
Forks3

Languages

C#

Security Score

77/100

Audited on Sep 13, 2025

No findings