public static string Serialize <T>(T contents) where T : class
        {
            var buffer = new StringBuilder();

            using var writer = new StringWriter(buffer);

            DataSetSerialization.CreateSerializer().Serialize(writer, contents, typeof(T));

            return(buffer.ToString());
        }
 public static T?Deserialize <T>(string contents) where T : class
 {
     using var reader = new JsonTextReader(new StringReader(contents));
     return(DataSetSerialization.CreateSerializer().Deserialize <T>(reader));
 }