News for hackers. Stuff that matters.
Re:Understanding the .NET ecosystem: The evolution of .NET i... by brushfoot on Tuesday March 21, 2023 @06:33PM (#35253643)
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();

There are no comments on this comment yet.