How to serialize and deserialize objects using NewtonSoft JSON
Some instructions on how to use Newtonsoft JSON to serialize and deserialize your objects in C# Step 1: Create a new Visual Studio project Just a simple console application will do: Step 2: Install Newtonsoft Json using Nuget Available at the NuGet site: https://www.nuget.org/packages/newtonsoft.json/ Enter the command to install Newtonsoft Json in the Visual Studio package manager console: [code language="xml"] Install-Package Newtonsoft.Json -Version 11.0.2 [/code] Step 3. Create an example class to serialize/deserialize [code language="csharp"] public class DataStructure { public string Name { get; set; } public List<int> Identifiers { get; set; } } [/code] Step 4. Create methods to serialize and deserialize [code language="csharp"] public static void Serialize(object obj) { var serializer = new JsonSerializer(); using (var sw = new StreamWriter(filePath)) usi...