Migrate controllers to Minimal APIs using API versioning
Download the code that shows how to migrate controllers to Minimal API endpoints using API versioning in an ASP.NET Core Web API.
You can learn more about how to migrate from controllers to Minimal APIs, or watch the video.
Download the code example
You'll need to fill out the code example form. We will send you an email where you can download the code example.
Software
This is the software that will need to be installed onto your machine.
Visual Studio 2026. Version 18.0.0 or above. It will work with the free community version.
.NET 10 SDK. Version 10.0.0 or above.
The application
Open up RoundTheCode.MigrateToMinApis.slnx, and run the application. The Swagger documentation will load at https://localhost:7156/swagger.
You can switch definitions in the top-right hand corner of the Swagger documentation.V1 shows the controller endpoints, and V2 shows the same endpoints using Minimal APIs.
Download this code example
Enter your email and we'll send you a download link.
Related code examples
An ASP.NET Core example of using the FromBody and FromQuery attribute. Handy if your request is null, or getting a 415 error.
Download a .NET 10 Web API integrated with Minimal APIs and SQL Server alongside Entity Framework Core and FluentValidation.
Download this code example
Enter your email and we'll send you a download link.