xxxxxxxxxx
//If you are using Visual Studio IDE
Step 1 : Copy the JSON body Make sure that the JSON string is well formatted.
Step 2 : Go to Edit=>Paste Special=>Paste JSON As Classes
xxxxxxxxxx
using System;
using Newtonsoft.Json;
class Program
{
static void Main()
{
// JSON string to be converted
string jsonString = "{\"name\":\"John\",\"age\":30,\"city\":\"New York\"}";
// Convert JSON to C#
var data = JsonConvert.DeserializeObject(jsonString);
// Display the converted C# object
Console.WriteLine(data);
}
}
xxxxxxxxxx
using Newtonsoft.Json;
using System;
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
public class Program
{
public static void Main()
{
Person person = new Person { Name = "John Doe", Age = 30 };
string json = JsonConvert.SerializeObject(person);
Console.WriteLine(json);
}
}
xxxxxxxxxx
public class CreateUserAccount
{
public CreateUserAccount(string username, string password)
{
Username = username;
Password = password;
}
public string Username { get; private set; }
public string Password { get; private set; }
}
xxxxxxxxxx
string response = "{\"Type\" : {\"isExactMatch\": \"true\"},\"Value\":{ \"jobtitle\": \"jobtitle\"}}";