2 ms·
Regards ceremony and DI: I think the templates are more Ruby on Rails style while the framework can be trimmed down to nodejs + express simplicity. This sample
by oaiey 6y ago
Regards ceremony and DI: I think the templates are more Ruby on Rails style while the framework can be trimmed down to nodejs + express simplicity. This sample here is node+express like equivalent (thanks to C# 9.0 top level statements, there is not even a Program class and a Main entry point)
WebHost.CreateDefaultBuilder().Configure(app =>
{
app.UseRouting();
app.UseEndpoints(e =>
{
e.MapGet("/", c => c.Response.WriteAsync("Hello world!"));
e.MapGet("hello/{name}", c => c.Response.WriteAsync($"Hello, {c.Request.RouteValues["name"]}"));
});
}).Build().Run();
I also stumble over that once in a while but I have no hard feeling on it.
- oaiey 6y agoThis here is the official answer of the Architect of .NET David Fowler (with a full TODO use case): https://github.com/davidfowl/Todos/blob/master/TodoBasic/Program.cs https://github.com/davidfowl/Todos/blob/master/TodoBasic/Pro...