/**
         * {@inheritDoc}
         */
        public void RegisterBaseType(Type baseType, Type keyType)
        {
            Type oldBaseType = baseTypes.GetExtension(keyType);

            if (oldBaseType == null)
            {
                baseTypes.Register(baseType, keyType);
                EntityInstantiationExtensionExtendable.RegisterEntityInstantiationExtension(Self, keyType);
            }
            else
            {
                baseTypes.Unregister(oldBaseType, keyType);
                baseTypes.Register(baseType, keyType);
            }

            // register keyType as interface
            if (keyType.IsInterface)
            {
                RegisterInterfaceTypes(new Type[] { keyType }, keyType);
            }

            // register all interfaces implemented by baseType
            foreach (Type interfaceClass in baseType.GetInterfaces())
            {
                if (interfaceClass.IsAssignableFrom(keyType))
                {
                    // registered above
                    continue;
                }
                RegisterInterfaceTypes(new Type[] { interfaceClass }, keyType);
            }
        }
 /**
  * {@inheritDoc}
  */
 public void UnregisterBaseType(Type baseType, Type keyType)
 {
     Type[] interfaceTypes = this.interfaceTypes.GetExtension(keyType);
     if (interfaceTypes != null)
     {
         this.interfaceTypes.Unregister(interfaceTypes, keyType);
     }
     baseTypes.Unregister(baseType, keyType);
     EntityInstantiationExtensionExtendable.UnregisterEntityInstantiationExtension(Self, keyType);
 }