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);
}