You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue intends to capture a smooth getting started experience with minimal APIs. Our goal is to have all experience smoothed (😺 ) out before we will move the new minimal api template from a package to OOB with the SDK.
Current user Experience
Description
😺
Smooth experience
😾
Bumpy experience
🙀
Confusing / Overwhelming experience
🎩
Stretch goal for the product
✔️
Available in the empty template OOB. No additional configuration required from the developer
Acquisition
Note : To try out minimal APIs for hosting and routing in web applications we announced in .NET 6 preview 4 today, create a new ASP.NET Core empty web app dotnet new web -o MinApi. ✔️
This issue intends to capture a smooth getting started experience with minimal APIs. Our goal is to have all experience smoothed (😺 ) out before we will move the new minimal api template from a package to OOB with the SDK.
Acquisition
Note : To try out minimal APIs for hosting and routing in web applications we announced in .NET 6 preview 4 today, create a new ASP.NET Core empty web app
dotnet new web -o MinApi. ✔️Phase 1: Minimal APIs template as a package
Install package Microsoft.AspNetCore.Minimal-api.Templates
dotnet new install Microsoft.AspNetCore.MinimalApi.Templates:: 0.1.0-preCreate a new minimal api
dotnet new api -o myapiPhase 2: New minimal APIs template shipped in .NET SDK
User installs .NET SDK
API template surfaces in the .NET CLI and Visual Studio new project dialogue.
Define a new endpoint ✔️ 😺
app.MapGet("/foo", () => "I am new endpoint");Open API support
Install the Microsoft Open API and Swagger packages.
Using .NET CLI
Microsoft open API
dotnet add package Swashbuckle.AspNetCore --version 6.1.4In Visual Studio
In Visual Studio you can use the Package Manager Console or Manage Nuget Package GUI.
Install-Package Swashbuckle.AspNetCore -Version 6.1.4Configure your the Swagger UI yourself
User configures Swagger UI on their own with the following snippets
Snippet 1: Below
var builder = WebApplication.CreateBuilder(args);add the following lines of code
Snippet 2: Above
app.MapGet("/", () => "Hello World!");add the following lines of code
Alternative path: Swagger turned on my default
Example: user runs their app and navigates to this URL
https://localhost:5001/docs/. No addtional code required.Working with data 😾
Working with In-memory database
Microsoft.EntityFrameworkCore.InMemoryImplement - GET, POST, PUT, DELETE.
Validation
details coming soon
Authorization
details coming soon
Deploy
details coming soon
Error messages