3 ms·
The boilerplate is pretty minimal nowadays. In 2020, C# introduced top-level statements, which removed a lot of the ceremony. You used to have a class, and the
by brushfoot 4y ago
The boilerplate is pretty minimal nowadays. In 2020, C# introduced top-level statements, which removed a lot of the ceremony.
You used to have a class, and there would typically be a separate Startup.cs file. Today, this is a complete .cs file for creating an API:
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.Run();