Beispiel #1
0
        /// <summary>
        /// Returns the EntitySet baseDir of the specified InterfaceType.
        /// </summary>
        /// <param baseDir="intf">the interface to resolve</param>
        /// <returns>the baseDir of the underlying entity set</returns>
        private string GetEntityName(InterfaceType intf)
        {
            if (intf == null)
            {
                throw new ArgumentNullException("intf");
            }
            var rootType = intf.GetRootType();

            return(rootType.Type.Name);
        }
Beispiel #2
0
        public IEnumerable this[InterfaceType t]
        {
            get
            {
                // Interface types are structs and can't be null
                //if (t == null) { throw new ArgumentNullException("t"); }
                var rootT = t.GetRootType();

                if (!_objects.ContainsKey(rootT))
                {
                    return(null);
                }

                Dictionary <TKey, IPersistenceObject> typeList = _objects[rootT];
                return(typeList.Values);
            }
        }
Beispiel #3
0
        public IPersistenceObject Lookup(InterfaceType t, TKey id)
        {
            // Interface types are structs and can't be null
            //if (t == null) { throw new ArgumentNullException("t"); }
            var rootT = t.GetRootType();

            if (!_objects.ContainsKey(rootT))
            {
                return(null);
            }

            IDictionary <TKey, IPersistenceObject> typeList = _objects[rootT];

            if (!typeList.ContainsKey(id))
            {
                return(null);
            }

            return(typeList[id]);
        }