private IClassMetadata GetMetaData(System.Type type)
        {
            if (LinqUtil.IsAnonymousType(type))
            {
                return(null);
            }

            string entityName = _sessionFactory.TryGetGuessEntityName(type);

            if (!String.IsNullOrEmpty(entityName) && _metaData.ContainsKey(entityName))
            {
                return(_metaData[entityName]);
            }

            if (_proxyTypes.ContainsKey(type))
            {
                return(_metaData[_proxyTypes[type]]);
            }

            return(null);
        }