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

            if (value == null)
            {
                return;
            }

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

            if (value == null)
            {
                return;
            }

            var nullableValue = (TValue?)value;

            dictionary.Add(_property.Property.Name, nullableValue.Value);
        }
Esempio n. 3
0
        public void WritePropertyToDictionary(IDictionary <string, object> dictionary, T obj)
        {
            var value = _property.Get(obj);

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

            if (values == null)
            {
                return;
            }

            object[] elementArray = values.Select(element => new object[] { element.Key, _elementConverter.GetDictionary(element.Value) })
                                    .ToArray <object>();

            dictionary.Add(_property.Property.Name, elementArray);
        }
Esempio n. 4
0
        public void WritePropertyToDictionary(IDictionary <string, object> dictionary, T obj)
        {
            var value = _property.Get(obj);

            var values = value as IList <TElement>;

            if (values == null)
            {
                return;
            }

            var elements = new object[values.Count];

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

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

            dictionary.Add(_property.Property.Name, value);
        }
Esempio n. 6
0
 public void WritePropertyToDictionary(IDictionary <string, object> dictionary, T obj)
 {
     dictionary.Add(_property.Property.Name, _property.Get(obj));
 }