コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public IEntryDescriptor GetDescriptor(object entity)
        {
            var _type = entity.GetType();

            if (!_innerCacheRepository.ContainsKey(_type))
            {
                _innerCacheRepository.Add(_type, new EntryDescriptor(_type));
            }

            return(_innerCacheRepository[_type]);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="serviceContract"></param>
        /// <returns></returns>
        public DbConnection DetachConnection(IDataServiceContract serviceContract)
        {
            if (null != serviceContract)
            {
                if (!_innerCacheRepository.ContainsKey(serviceContract.Host))
                {
                    lock (_syncRoot)
                    {
                        _innerCacheRepository.Add(serviceContract.Host, new DbConnection(OperationContext, serviceContract));
                    }
                }

                return(_innerCacheRepository[serviceContract.Host]);
            }

            return(null);
        }