0

I'm trying to implement a JSON api for my mobile application. Altough many of samples use System.Json, it is deperecated now. What is its current replacment in .NET?

VSB
  • 9,825
  • 16
  • 72
  • 145
  • 2
    `Json` is a method defined in the base controller to return a json representation of the object you are passing to it. Behind the scene it uses the Newtonsoft Json serializer to do that. – Shyju Feb 17 '17 at 21:54
  • http://stackoverflow.com/q/12859319/215552 – Heretic Monkey Feb 17 '17 at 21:56
  • One can easily do a web search for ".NET JSON" and find many useful results. Why did you ask here? – mason Feb 17 '17 at 21:56
  • @mason I did reword the question. But deprecation of an API/Library is normal and It would be normal to ask for its current replacement. like [this](http://stackoverflow.com/questions/27141279/setbackgrounddrawable-deprecated) and [this](http://stackoverflow.com/questions/27141279/setbackgrounddrawable-deprecated). – VSB Feb 17 '17 at 22:12
  • @VSB The existence of questions that break our rules doesn't excuse creating more questions that break our rules. It's off topic. – mason Feb 17 '17 at 22:18
  • 2
    @mason I do not think this question, nor the other two cited, actually break the rules. This is a purely technical question about the namespace of the library included in .NET that replaced an old one. I am all for rules, but applying them too strictly when they solve nothing doesn't help. This question will NOT attract opiniated answers nor spam. – Drunken Code Monkey Feb 17 '17 at 23:35

1 Answers1

2

The most used library is Json.net

http://www.newtonsoft.com/json

Michel Amorosa
  • 475
  • 5
  • 11
  • 3
    Even Microsoft relies on it for ASP.Net MVC 4 WebAPI and 5... Also, with a ASP.NET MVC WebAPI, you really should not have much to do with JSON manually, your controller just needs to return a serializable object (or a collection of them). – Drunken Code Monkey Feb 17 '17 at 21:55
  • Let's not answer [off topic](http://stackoverflow.com/help/on-topic) questions. It only encourages more. – mason Feb 17 '17 at 21:57
  • Why is it off topic? It's a perfectly valid question if you ask me. – Drunken Code Monkey Feb 17 '17 at 21:58
  • 1
    @DrunkenCodeMonkey From the page I linked to above: "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – mason Feb 17 '17 at 22:01
  • I think mason is actually off here. This is not a recommendation, it is a library that has been deprecated and then replaced by Microsoft. No opinions necessary here. – Drunken Code Monkey Feb 17 '17 at 23:32