public void WritePropertyToDictionary(IDictionary <string, object> dictionary, T obj)
        {
            object value = _property.Get(obj);

            if (value == null)
            {
                return;
            }

            var values = value as IDictionary <TKey, TValue>;

            if (values == null)
            {
                return;
            }

            var elements = new List <object>();

            foreach (var element in values)
            {
                elements.Add(new object[] { element.Key, _elementConverter.GetDictionary(element.Value) });
            }

            dictionary.Add(_property.Property.Name, elements.ToArray());
        }
        public void WritePropertyToDictionary(IDictionary <string, object> dictionary, T obj)
        {
            object value = _property.Get(obj);

            if (value == null)
            {
                return;
            }

            var values = value as IList <TElement>;

            if (values == null)
            {
                return;
            }

            var elements = new object[values.Count];

            for (int i = 0; i < values.Count; i++)
            {
                elements[i] = _elementConverter.GetDictionary(values[i]);
            }

            dictionary.Add(_property.Property.Name, elements);
        }
        public void WritePropertyToDictionary(IDictionary <string, object> dictionary, T obj)
        {
            IDictionary <string, object> value = _converter.GetDictionary(obj);

            dictionary.Add(_property.Property.Name, value);
        }