Hacker News new | ask | show | jobs
by neonsunset 1390 days ago
app.MapPut("ping/pong/yolo", ([FromBody] Payload request) => {...});

record Payload(Foo Foo);

record Foo(string Bar);

or

app.MapPut("ping/pong/yolo", (JsonElement json) => {...});

Basically, just avoid outdated blog posts and articles :D

1 comments

this looks like asp.net core
No one in their sane mind would use ASP.NET for new projects (it is legacy and a business risk) nowadays so it's reasonable to assume that everyone means ASP.NET Core given the .NET 7 context.
the context was asp.net mvc specifically
ASP.NET MVC is dead. It has been over 6 years; you need to update yourself.