An open API service indexing awesome lists of open source software.

https://github.com/toolsfactory/toolsfactory.common.minimalapi

A small helper library to make MinimalApi development smoother
https://github.com/toolsfactory/toolsfactory.common.minimalapi

Last synced: 5 months ago
JSON representation

A small helper library to make MinimalApi development smoother

Awesome Lists containing this project

README

          

# Toolsfactory.Common.MinimalApi

This project provides a collection of helper classes and extensions for developing Minimal APIs with .NET 9.

## Features

- Base classes and interfaces for defining endpoints
- Extension methods for `IServiceCollection` and `IEndpointRouteBuilder`
- Support for modular and structured API development

## Usage

Example for registering and defining endpoints:

```csharp
// In Program.cs
builder.Services.AddEndpointDefinitions(typeof(Program).Assembly);
app.UseEndpointDefinitions();
```

```csharp
// In an endpoint definition class
public class MyEndpointDefinition : EndpointDefinition
{
public override void DefineEndpoints(IEndpointRouteBuilder app)
{
app.MapGet("/hello", () => "Hello World!");
}
}
```