Beispiel #1
0
        public static JsonSerializer GetJsonSerializer()
        {
            if (_jsonSerializer == null)
            {
                JsonSerializerSettings settings = new JsonSerializerSettings();
                settings.Converters = new List <JsonConverter>(JdUtils.GetJsonConverters());
                _jsonSerializer     = JsonSerializer.Create(settings);
            }

            return(_jsonSerializer);
        }
Beispiel #2
0
        public virtual String GetParamJson()
        {
            var paramters = new Dictionary <String, Object>();

            PrepareParam(paramters);
            foreach (var added in _addedParamters)
            {
                if (!paramters.ContainsKey(added.Key))
                {
                    paramters.Add(added.Key, added.Value);
                }
            }

            return(JsonConvert.SerializeObject(paramters, JdUtils.GetJsonConverters()));
        }