コード
class MainClass
{
public static void Main(string[] args)
{
var beforeJsonData = new BeforemetaData();
beforeJsonData.Greeting = "おっはー";
var beforeJson = JsonConvert.SerializeObject(beforeJsonData);
Console.WriteLine(beforeJson);
var afterJsonObject = JsonConvert.DeserializeObject<metaData>(beforeJson);
afterJsonObject.Message = "とりま申し込も!";
var afterJson = JsonConvert.SerializeObject(afterJsonObject);
Console.WriteLine(afterJson);
}
}
public class BeforemetaData
{
public string Greeting
{
get;
set;
}
}
public class metaData
{
public string Greeting
{
get;
set;
}
public string Message
{
get;
set;
}
}