I'm having the following classes on C#:
public class Record { public Record() { this.Artists = new List<Artist>(); } public int Id { get; set; } pu_Stack Overflow中文网
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.
public class Record { public Record() { this.Artists = new List<Artist>(); } public int Id { get; set; } pu 问问题
您应该为 .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 }); });