Esempio n. 1
0
        public void Add(String typeName, Object id, ExpandoObject value)
        {
            var           key = Tuple.Create(typeName, id);
            RefMapperItem item;

            if (!TryGetValue(key, out item))
            {
                item = new RefMapperItem();
                Add(key, item);
            }
            item.AddToList(value);
            if (item.Source != null)
            {
                foreach (var target in item.List)
                {
                    target.CopyFrom(item.Source);
                }
            }
        }
Esempio n. 2
0
        public void MergeObject(String typeName, object id, ExpandoObject source)
        {
            var           key = Tuple.Create(typeName, id);
            RefMapperItem item;

            if (TryGetValue(key, out item))
            {
                foreach (var target in item.List)
                {
                    target.CopyFrom(source);
                }
            }
            else
            {
                // forwar definition
                item        = new RefMapperItem();
                item.Source = source;
                Add(key, item);
            }
        }