string jsonInput="{'Id': '2250000', 'Email': '[email protected]', 'FirstName': 'Naveen', 'LastName': 'Yedugani', 'PreferredName': 'Nav'}";
JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
Customer objCustomer = jsonSerializer.Deserialize<Customer>(jsonInput)
Thats it :)
How to convert JSON object to a Class object in c#
Use JavaScriptSerializer to convert Json object to a C# Class.
You need to add System.Web.Extensions to the project if you want to use JavaScriptSerializer
For example if you have a Json Customer data and want to convert to the Customer Class object then see the example below: