/// <inheritdoc /> public async Task DeleteBranch(string branchId) { var page = await _streamStore.ListStreams(Configuration.BatchSize); while (page.StreamIds.Length > 0) { foreach (var s in page.StreamIds) { if (!s.StartsWith(branchId) || !s.Contains("Command")) { continue; } await _streamStore.DeleteStream(s); _log.Debug($"Deleted {nameof(ICommand)} stream {s}"); } page = await page.Next(); } }
public async Task <IActionResult> DeleteSubscription( Guid id, CancellationToken cancellationToken) { var subscriptions = await _repository.Load(cancellationToken); var subscription = subscriptions.Get(id); var deleted = subscriptions.Delete(id); if (!deleted) { return(NotFound()); } await _repository.Save(subscriptions, cancellationToken); // delete the inbox var streamId = subscription.GetInboxStreamId(); await _streamStore.DeleteStream(streamId, cancellationToken : cancellationToken); return(Ok()); }
public async Task <Unit> Invoke(IStreamStore streamStore, CancellationToken ct) { await streamStore.DeleteStream(StreamId, ExpectedVersion, ct); return(Unit.Instance); }
public async Task DeleteStream(string streamId) { await _store.DeleteStream(streamId); }