Beispiel #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);
        }
Beispiel #2
0
        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);
        }
        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, element.Value })
                                    .ToArray <object>();

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

            var values = value as TElement[];

            if (values == null)
            {
                return;
            }

            var elements = new IDictionary <string, object> [values.Length];

            for (var i = 0; i < values.Length; 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(_property.Get(obj));

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