Guide
Json.NET
- JsonConvert.SerializeObject
- JsonConvert.DeserializeObject
install
Use NuGet to download the package
"Project" -> "Manage NuGet packages" -> "Search for "newtonsoft json". -> click "install".
code
reference
using Newtonsoft.Json;
serialize collections
1 | Product p1 = new Product |
deserialize collections
1 | string json = @"[ |
serialize to json file
1 | public class Movie |
Reference
History
- 20190910: created.