Orc.NuGetExplorer.RepositoryCacheService.GetSerializableRepository C# (CSharp) Метод

GetSerializableRepository() публичный Метод

public GetSerializableRepository ( string name, string source, PackageOperationType operationType, Func packageRepositoryFactory, bool renew = false ) : IRepository
name string
source string
operationType PackageOperationType
packageRepositoryFactory Func
renew bool
Результат IRepository
        public IRepository GetSerializableRepository(string name, string source, PackageOperationType operationType, Func<IPackageRepository> packageRepositoryFactory, bool renew = false)
        {
            Argument.IsNotNullOrEmpty(() => name);
            Argument.IsNotNull(() => packageRepositoryFactory);

            var key = GetKey(operationType, name);

            int id;
            if (_keyIdDictionary.TryGetValue(key, out id))
            {
                if (!renew)
                {
                    return _idTupleDictionary[id].Item1;
                }

                return CreateSerializableRepository(id, name, source, operationType, packageRepositoryFactory);
            }

            id = _idCounter++;
            _keyIdDictionary.Add(key, id);

            return CreateSerializableRepository(id, name, source, operationType, packageRepositoryFactory);
        }