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: I too feel the same...there are less number of scenarios for JsonResult: 1) To use Json for all application, modify global formatters to only have Json formatter. 2) To use Json only for a controller, create per-controller config to only have Json formatter. 3) To use Json only for an action, use existing action result, which is use 'Content' method which creates FormattedContentResult.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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