Last week
.NET 6 Preview 7
was released and one of the new features that got introduced to the world of
ASP.NET Core is a new static
Results
utility class to produce common HTTP responses as IResults. IResult is a new return type that got introduced with Minimal APIs.
If you are new to Minimal APIs in ASP.NET Core or need to refresh your memories, you can read these posts.
Previously we had to use/maintain our own class to Map IActionResult to IResult. With this new Results utility class, we no longer have to do that.
If you explore the Results class, it has IResult types for almost all the regularly used HTTP responses.
You can find the sample code here,
Hope this helps.
Happy Coding.
Regards,
Jaliya
No comments:
Post a Comment