How to serialize and deserialize a json using object (pre-defined class) in c#? Answer: Serialize class object into string: public class Employee { public int EmployeeId { get; set;} public string EmployeeName { get; set;} public string Designation { get; set;} } var employee = new Employee() { EmployeeId = 1, EmployeeName = "temp", Designation = "Software Engineer" } Above class data can be serialized using below code snippet, please make sure Newtonsoft.Json is included in the namespace string output = JsonConvert.SerializeObject(employee); Deserialize Json to class object: public class Employee { public int EmployeeId { get; set;} public string EmployeeName { get; set;} public string Designation { get; set;} } var data = "{\"EmployeeId\":1,\"EmployeeName\":\"temp\",\"Designation\":\"Software Engineer\"}" It can be deserialized using below code snippet, please make sure Newtonsoft.Json is i...