Visual Studio project template for rapid setup and configuration for .NET Minimal APIs. Save time writing the same boilerplate code every time you start a new microservice or backend project.
- Modern .NET Architecture: Built using the latest lightweight .NET patterns, keeping
Program.cscompletely uncluttered. - 📂 Enterprise-Ready Folder Layout: A decoupled, production-ready structure that enforces clean separation of concerns:
Data- Entity Framework Core context configuration.EndPoints- Clean mapping viaIEndpointRouteBuilderextensions to keep route logic out of your configuration files.Models- Separated intoDomainentities (database-facing) andDtos(data transfer objects for request/response payloads) to prevent over-posting and secure your data layer.Services- Pre-structured for Dependency Injection with explicitInterfacedefinitions and theRepositorypattern for decoupled data access layers.
- Entity Framework Core Integrated: Fully configured with
AppDbContextand local SQL Server infrastructure placeholders. - Modern API Documentation: Native
.AddOpenApi()paired with Scalar API Reference (app.MapScalarApiReference()) for a beautiful interactive API testing UI right out of the box. - Pre-configured
launchSettings.jsonwithlaunchUrl: "scalar/v1", launching you directly into your interactive API documentation the second the application starts.
Since this is a custom Visual Studio template repository, you can generate and install it into your local environment in just a few quick steps:
Clone this repository to your local machine and open the .slnx (or .sln) file in Visual Studio.
- In the top menu bar, click on Project > Export Template....
- Leave Project template selected and choose your project from the dropdown, then click Next.
- (Optional) Customize your template name, icon, or description, and ensure the checkbox for "Automatically import the template into Visual Studio" is checked.
- Click Finish. Visual Studio will automatically build the
.zipfile and drop it straight into your local user templates folder for you!
- Restart or open a new instance of Visual Studio.
- Click Create a new project.
- Search for
vs-minimal-api-template(or the custom name you gave it). - Name your new API, hit Create, and start coding!
This project is licensed under the MIT License - feel free to use it for personal or commercial projects!