private byte[] Serialize(object obj) { string json = JsonConvert.SerializeObject(obj); return Encoding.UTF8.GetBytes(json); }