I've seen a lot of arguments for why moving from WCF to Web API is a good move, but I haven't seen much on migrating from a controller with JsonResult actions to a Web API project. Can anyone provide the main benefits on switching to the Web API platform, or does it make sense to not migrate and stay on MVC3?
WebAPI provides a lot of stuff out of the box that you don't get with a standard JsonResult. For instance, WebAPI is aware of the content types the caller expects, and can return Json, or XML or other types as requested.
Another nice feature is that WebAPI is oData aware, and you can use standard oData HTTP commands to filter and perform other actions, all without your code needing to do anything specific.
WebAPI has tons of nifty features that make a nice webservice, without the overhead of a full WCF service or asmx.
If you're happy with a JsonResult though, there's no need to rewrite it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With