Ejemplo n.º 1
0
        private static Dictionary<string, object> BuildJsonUpdateDict(UpdatableUserObject userObject)
        {
            var updates = new Dictionary<string, object>();
            var type = userObject.GetType();

            foreach (var pair in JsonUpdatePropertyMap)
            {
                object value = type.GetProperty(pair.Key).GetValue(userObject, null);
                if (value != null)
                {
                    updates[pair.Value] = value;
                }
            }
            return updates;
        }