Skip to content

Latest commit

 

History

History

minimal-api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Minimal API (39)

  • Hello World

    This is Hello World ASP.NET Core 6 app using the new WebApplication instead of IHostBuilder.

Minimal Routing (9)

In these examples we are using the familiar Host.CreateDefaultBuilder(args) host configuration style to emphasis that the new Minimal Routing feature works in both existing style and also in the new minimal hosting API.

Route Constraints (12)

Link Generator (1)

Parameter Binding (10)

Antiforgery

Endpoint Filter

  • Endpoint Filter - 1

    This sample shows how to apply an Endpoint filter to your minimal API.

  • Endpoint Filter - 2

    This sample shows how to apply multiple Endpoint filters to your minimal APIs.

  • Endpoint Filter - 3

    This examples shows the sequence of code execution before RouteHandlerFilterDelegate and after RouteHandlerFilterDelegate in multiple endpoint filters.

  • Endpoint Filter - 4

    Use IStatusCodeHttpResult to detect return result in filter.

Route Group

  • Route Group - 1

    MapGroup() extension methods allow grouping of endpoints with a common prefix. It also allow group metadata to be attached to the group.

  • Route Group - 2

    Use .WithTags(), .WithDescription(), .WithSummary() to enrich OpenAPI information for all the endpoints in the group.

  • Route Group - 3

    Use .ExcludeFromDescription to exclude endpoints from OpenAPI description.

Minimal API Improvements

  • Minimal API Form Model Binding

    This sample demonstrates the ability to use [FromForm] binding in Minimal API.

  • Typed Results - 1

    Microsoft.AspNetCore.Http.TypedResults static class is the “typed” equivalent of the existing Microsoft.AspNetCore.Http.Results class.

  • WithOpenApi - 1

    This sample demonstrate the usage of WithOpenApi extension method available in Microsoft.AspNetCore.OpenApi to customize OpenAPI operation information.

  • Results<> Union Type

    Results<TResult1, TResult2, TResultN> provides better description of the result of the operation that OpenAPI/Swagger can use in describing the API.

  • IFormFile

    This sample demonstrates the usage of IFormFile to upload a file in Minimal API.

  • IFormFileCollection

    This sample demonstrates the usage of IFormFileCollection to upload multiple files in Minimal API.

dotnet8