public string SerializeHashtable(Hashtable templateParameterObject, bool addValueLayer) { if (templateParameterObject == null) { return null; } Dictionary<string, object> parametersDictionary = templateParameterObject.ToDictionary(addValueLayer); return JsonConvert.SerializeObject(parametersDictionary, new JsonSerializerSettings { TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple, TypeNameHandling = TypeNameHandling.None, Formatting = Formatting.Indented }); }