Re:Understanding the .NET ecosystem: The evolution of .NET i...
by nonethewiser on Tuesday March 21, 2023 @06:26PM
(#35253554)
Isn’t there still lots of boilerplate, it’s just generated for you?
[ Parent
| on HN ]
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();