Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I'm having the following classes on C#:
public class Record { public Record() { this.Artists = new List<Artist>(); } public int Id { get; set; } pu 问问题
问问题 2013-10-14T12:19:17.927 804 次 This question shows research effort; it is useful and clear 0 This question does not show any research effort; it is unclear or not useful Bookmark this question. Show activity on this post. c#javascriptjqueryjsonasp.net-web-api 4 2 回答 2 This answer is useful 3 您应该为 .NET 集合使用 JavaScript Array。 var record = { name: "Whatever", description: "Something else", artists: [{ name: "Artist Name", album: "Some Album", songs: [{ name: "Some Song" }] }] }; Web API 会将 JSON 视为不区分大小写。 于 2013-10-14T12:31:15.330 回答 This answer is useful -1 您需要将此代码用于 jQuery REST POST JSON 列表 var jsonObj = []; $.each({ name: "John", lang: "JS" }, function (key,value) { jsonObj.push( { key: value }); }); 于 2013-10-14T12:46:18.717 回答 Related 2 php - 将数组拆分为子数组 1 javascript - Marionette Collection View,获取集合不会触发事件 1 maps - WP8:在地图控件中获取标签位置 1 asp.net - 使用 Web 服务和 Web 方法避免回发 1 java - Java REST - JQuery 多部分/表单数据文件上传的正确参数? 1 jquery - jQuery 验证插件,按名称分组输入元素 4 c# - .CompareTo(object value) 方法是否有任何已知的实现实际上返回小于 -1 或大于 1 的值? 3 windows - 如何从公司代理后面的 github 克隆 2 ios - UISlider - 适用于 0.0 到 1.0 卷 - iOS XCODE 4 jquery - $.ajax() 访问 done() 中发送的值 Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641
您应该为 .NET 集合使用 JavaScript Array。
Array
var record = { name: "Whatever", description: "Something else", artists: [{ name: "Artist Name", album: "Some Album", songs: [{ name: "Some Song" }] }] };
Web API 会将 JSON 视为不区分大小写。
您需要将此代码用于 jQuery REST POST JSON 列表
var jsonObj = []; $.each({ name: "John", lang: "JS" }, function (key,value) { jsonObj.push( { key: value }); });