加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

Asp.net MVC json还是Json.net?

发布时间:2020-12-16 00:39:00 所属栏目:asp.Net 来源:网络整理
导读:我现在正在使用asp.net mvc,并想知道使用内置的Json或者 Json.Net是什么更好的选择我不知道是否有优势超过另一个。 另外如果我选择下去Json.Net的路线,那么我应该用稳定版本还是beta 4?我不知道贝塔是不稳定的。 解决方法 你可能有问题 serializing dates
我现在正在使用asp.net mvc,并想知道使用内置的Json或者 Json.Net是什么更好的选择我不知道是否有优势超过另一个。

另外如果我选择下去Json.Net的路线,那么我应该用稳定版本还是beta 4?我不知道贝塔是不稳定的。

解决方法

你可能有问题 serializing dates with the MVC JSON.我的答案在这个帖子重复下面。

If you are not tied to the MS JSON serializer you could use Json.NET. It comes with an IsoDateTimeConverter.
This will serialize dates into an 07001 formatted string.

For instance,in our project
serializing myObject is handled via
the following code.

06000

If you decide to take the Json.NET
plunge you’ll also want to grab
07002 as it returns an
ActionResult that can be used in
ASP.NET MVC application. It’s quite
easy to use.

For more info see: 07003

我们目前正在使用Json.NET v3.5 Beta 4,并没有遇到问题。但是,我们还没有真正对我们的系统征税,因为它还没有进入生产阶段。您的里程可能会因您使用的框架多少而有所不同。

希望这可以帮助。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读