protected override Task OnActivate() { _artifactId = (ArtifactId)ActorKey.Value; _storage = _artifactStorageProvider.Create(_artifactId.Namespace) .VerifyNotNull($"Namespace not found for {ActorKey.Value}"); return(Task.CompletedTask); }
public async Task <IReadOnlyList <string> > List(QueryParameter queryParameter, CancellationToken token = default) { queryParameter .VerifyNotNull(nameof(queryParameter)) .VerifyAssert(x => !x.Namespace.IsEmpty(), x => $"{nameof(x.Namespace)} is required"); IArtifactStorage getStorage(string nameSpace) => _artifactStorageProvider.Create(queryParameter.Namespace !) .VerifyNotNull($"{queryParameter.Namespace} {nameof(queryParameter.Namespace)} not found"); IArtifactStorage artifactStorage = _namespaceCache.GetOrAdd(queryParameter.Namespace !, x => getStorage(queryParameter.Namespace !)); return(await artifactStorage.List(queryParameter, token)); }