ASP.NET Core is a free, open-source, cross-platform web framework for .NET, built and maintained by Microsoft. It's reported in roughly 19.7% of developer surveys, the #6 most-used web technology worldwide. It's the rewritten, fully open-source successor to classic Windows-only ASP.NET, running natively on Windows, macOS, and Linux, and is used heavily for building high-performance APIs and enterprise web apps in C#.
Modern ASP.NET Core supports Minimal APIs โ a whole HTTP endpoint defined in a single Program.cs file, no controllers required.
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/api/users/{id}", (int id) =>
{
return new { Id = id, Name = "Ava Chen" };
});
app.Run();
Install the .NET SDK, then scaffold a new web API project with the dotnet CLI.
# scaffold a new minimal Web API project
dotnet new webapi -n MyApi
cd MyApi
dotnet run