Beispiel #1
0
        public object Clone()
        {
            InMemoryEntitySetDictionary inMemoryEntitySetDictionaryClone = new InMemoryEntitySetDictionary();

            foreach (Type t in this.Keys)
            {
                IList newList = this.CloneList(this[t], t, this.GetTypes());
                inMemoryEntitySetDictionaryClone.Add(t, newList);
            }
            this.HookupRelationshipsInClone(inMemoryEntitySetDictionaryClone, this.GetTypes());
            return(inMemoryEntitySetDictionaryClone);
        }
Beispiel #2
0
        public InMemoryEntitySetDictionary InitializeEntitySetDictionary()
        {
            //Create List of t's with the correct types
            InMemoryEntitySetDictionary inMemoryDictionary = new InMemoryEntitySetDictionary();

            foreach (PropertyInfo info in this.GetType().GetProperties())
            {
                if (typeof(IQueryable).IsAssignableFrom(info.PropertyType))
                {
                    Type  t    = info.PropertyType.GetGenericArguments()[0];
                    IList list = (IList)InMemoryEntitySetDictionary.CreateGeneric(typeof(List <>), t, null);
                    inMemoryDictionary.Add(t, list);
                }
            }
            return(inMemoryDictionary);
        }