Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ASP.NET when to use IActionResult and when to use IResult?

I am trying to understand what the pros and cons are of IActionResult and IResult as return types and when to use the approopriate one. From what i’ve gathered IActionResult is just like IResult but with more options on how to handle the result?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

IActionResult :: Defines a contract that represents the result of an action method.ASP.NET Core 7

IActionResult allows you to provide some more operations based on your actions like redirecting, changing the response’s format etc.

Use IActionResult on the side of your web application – MVC, since it gives you more approaches to handle requests.

IResult :: Defines a contract that represents the result of an HTTP endpoint. ASP.NET Core 7

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading