public void PostInstantiate(string entityName, Type persistentClass, ISet <Type> interfaces, MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType)
        {
            if (persistentClass.IsGenericType)
            {
                return;
            }

            int  interfacesCount = interfaces.Count;
            bool isClassProxy    = interfacesCount == 1;

            Type[] ifaces = new Type[interfacesCount];
            interfaces.CopyTo(ifaces, 0);

            Type proxyType;

            if (isClassProxy)
            {
                proxyType = _proxyBuilder.CreateClassProxy(persistentClass, ifaces, ProxyGenerationOptions.Default);
            }
            else
            {
                proxyType = _proxyBuilder.CreateInterfaceProxyTypeWithoutTarget(ifaces[0], ifaces, ProxyGenerationOptions.Default);
            }

            _proxies[entityName] = proxyType;
        }
        /// <summary>
        /// Ensures that a proxy has been generated for the particular type in this context
        /// </summary>
        public void AddProxy(Type type)
        {
            Type proxyType;

            if (_cache.TryGetValue(type, out proxyType))
            {
                return;
            }

            lock (_cache) {
                if (_cache.TryGetValue(type, out proxyType))
                {
                    return;
                }

                _cache[type] = _proxyBuilder.CreateClassProxy(type, ProxyGenerationOptions.Default);
            }
        }