Tolitech.Presentation.API.Generators.Abstractions 1.0.0-preview.1

This is a prerelease version of Tolitech.Presentation.API.Generators.Abstractions.
dotnet add package Tolitech.Presentation.API.Generators.Abstractions --version 1.0.0-preview.1
                    
NuGet\Install-Package Tolitech.Presentation.API.Generators.Abstractions -Version 1.0.0-preview.1
                    
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="Tolitech.Presentation.API.Generators.Abstractions" Version="1.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tolitech.Presentation.API.Generators.Abstractions" Version="1.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Tolitech.Presentation.API.Generators.Abstractions" />
                    
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 Tolitech.Presentation.API.Generators.Abstractions --version 1.0.0-preview.1
                    
#r "nuget: Tolitech.Presentation.API.Generators.Abstractions, 1.0.0-preview.1"
                    
#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 Tolitech.Presentation.API.Generators.Abstractions@1.0.0-preview.1
                    
#: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=Tolitech.Presentation.API.Generators.Abstractions&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Tolitech.Presentation.API.Generators.Abstractions&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Tool

Tolitech.Presentation.API.Generators.Abstractions

Overview

This project provides an abstraction for endpoint definition in ASP.NET applications, making it easier to standardize and automatically register HTTP routes. The main goal is to allow endpoints to be defined via interfaces, promoting organization and extensibility.

Main Interface

public interface IEndpoint
{
    static abstract void MapEndpoint(IEndpointRouteBuilder app);
}
  • IEndpoint: Interface to be implemented by classes representing endpoints. The static MapEndpoint method is responsible for registering routes in the application's pipeline.

How to Use

  1. Implement the IEndpoint interface:
using Tolitech.Presentation.API.Generators.Abstractions;
using Microsoft.AspNetCore.Routing;

public sealed class MyEndpoint : IEndpoint
{
    public static void MapEndpoint(IEndpointRouteBuilder app)
    {
        app.MapGet("/my-endpoint", () => "Hello, world!");
    }
}
  1. Use the generator to automatically register all endpoints:

When used together with Tolitech.Presentation.API.Generators, all endpoints implementing IEndpoint will be automatically registered.

Benefits

  • Standardization of endpoint definitions
  • Easier testing and maintenance
  • Integration with code generators

Requirements

  • ASP.NET Core

Examples

Below is an example of implementation and registration:

public sealed class TestEndpoint : IEndpoint
{
    public static void MapEndpoint(IEndpointRouteBuilder app)
    {
        app.MapGet("/test", () => "Testing endpoint!");
    }
}

When running the application, the /test endpoint will be available automatically if the generator is used.

Notes

This project is intended to be used together with Tolitech.Presentation.API.Generators for automated endpoint registration.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.1 85 7/27/2025