protected function setAppConfig(AppConfig $appConfig)
    {
        if ($this->appConfig !== null) {
            throw new InvalidArgumentException(
                'Application configset already assigned.'
            );
        }

        $dynConfig = $this->dynamicConfig();
        if ($dynConfig instanceof DelegatesAwareInterface) {
            $dynConfig->prependDelegate($appConfig);
            $this->appConfig = $dynConfig;
        } elseif ($dynConfig instanceof EntityInterface) {
            $appConfig['dynamic'] = $dynConfig;
            $appConfig->prependDelegate($dynConfig);
            $this->appConfig = $appConfig;
        } else {
            $this->appConfig = $appConfig;
        }

        return $this;
    }