public override ICustomTypeDescriptor GetTypeDescriptor(Type type, ICustomTypeDescriptor parent)
        {
            ICustomTypeDescriptor td;

            if (!_descriptors.TryGetValue(type, out td))
            {
                // call base in order to keep chained the TypeDescriptors
                parent = base.GetTypeDescriptor(type, parent);
                //Assuming that an eventual metadata class is defined in the same assembly of the domain service class
                //and has the same name of the class + _Metadata; i.e. Customer => Customer_Metadata
                Type metaDataType = _domainServiceType.Assembly.GetType(type.FullName + "_Metadata");

                if (_nhConfiguration.ClassMappings.Count(x => x.MappedClass.FullName == type.FullName) > 0)
                {
                    td = new NHibernateTypeDescriptor(type, parent, _nhConfiguration, metaDataType);
                }
                else
                {
                    td = parent;
                }

                _descriptors[type] = td;
            }
            return(td);
        }
        public override ICustomTypeDescriptor GetTypeDescriptor(Type type, ICustomTypeDescriptor parent)
        {
            ICustomTypeDescriptor td;
            if (!_descriptors.TryGetValue(type, out td))
            {
                // call base in order to keep chained the TypeDescriptors
                parent = base.GetTypeDescriptor(type, parent);
                //Assuming that an eventual metadata class is defined in the same assembly of the domain service class
                //and has the same name of the class + _Metadata; i.e. Customer => Customer_Metadata
                Type metaDataType = _domainServiceType.Assembly.GetType(type.FullName + "_Metadata");

                if (_nhConfiguration.ClassMappings.Count(x => x.MappedClass.FullName == type.FullName) > 0)
                    td = new NHibernateTypeDescriptor(type, parent, _nhConfiguration, metaDataType);
                else
                    td = parent;

                _descriptors[type] = td;
            }
            return td;
        }