示例#1
0
        public InitInput Validate()
        {
            try
            {
                CacheConfig.ThrowIfNull($"{nameof(CacheConfig)}");
                if (CacheConfig.AdType == AdditionalData.Database)
                {
                    AdditionalDataConnectionMgr.ThrowIfNull($"{nameof(AdditionalDataConnectionMgr)}");
                }
                ReloadConfig.ThrowIfNull($"{nameof(ReloadConfig)}");
                SerializationConfig.ThrowIfNull($"{nameof(SerializationConfig)}");
                TopLevelLocalDirectory.ThrowIfNullOrNonExisting($"{nameof(TopLevelLocalDirectory)}");
                ActualDataConnectionMgr.ThrowIfNull($"{nameof(ActualDataConnectionMgr)}");
                Logger.ThrowIfNull($"{nameof(Logger)}");

                return(this);
            }
            catch (ArgumentException e)
            {
                throw new AsyncCacheException(AsyncCacheErrorCode.InvalidConfig, "Some config is invalid", e);
            }
        }