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); }
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); }
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); }
public void WritePropertyToDictionary(IDictionary <string, object> dictionary, T obj) { IDictionary <string, object> value = _converter.GetDictionary(_property.Get(obj)); dictionary.Add(_property.Property.Name, value); }
public void WritePropertyToDictionary(IDictionary <string, object> dictionary, T obj) { dictionary.Add(_property.Property.Name, _property.Get(obj)); }