Skip to content

Instantly share code, notes, and snippets.

View kakisoft's full-sized avatar
😄
YES!

kakisoft kakisoft

😄
YES!
View GitHub Profile
public static class JsonUtility
{
/// <summary>
/// 任意のオブジェクトを JSON メッセージへシリアライズします。
/// </summary>
public static string Serialize(object graph)
{
using (var stream = new MemoryStream())
{
var serializer = new DataContractJsonSerializer(graph.GetType());