Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Unassigned: Remove the JsonResult from ASP.NET Web API [1193]

$
0
0
Hi,

Today, I saw that ASP.NET Web API now has [JsonResult](https://aspnetwebstack.codeplex.com/SourceControl/latest#src/System.Web.Http/Results/JsonResult.cs) and even a Json method on ApiController. Just what we needed all along! I cannot think of any words which would describe my reaction when I saw it but maybe this picture can give a hint: [http://i.imgur.com/Bp9an.gif](http://i.imgur.com/Bp9an.gif)

Why on God's green earth do we have this? Why do we try to mess with HTTP and beautiful content negotiation that ASP.NET Web API framework has? This's harm! Please, just remove it and it will be nothing but a commit history.

Thanks!
Comments: @kichalla Completely agree. I just don't think that media type logic belongs to the the action level. If you return a specifically formatted result from there, you make your whole API incapable of conneg (even if you don't need to support any other media types). What you gain is very little and what you potentially lose is very big. Not to mention the confusion this will bring. Formatters are great and please don't reinvent the wheel again by doing something like this.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>