Skip to content

Commit 4b53e96

Browse files
committed
add projection reset to client
1 parent d88ac61 commit 4b53e96

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/EventStore.Client.ProjectionManagement/EventStoreProjectionManagementClient.Control.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ public async Task EnableAsync(string name, UserCredentials? userCredentials = nu
2222
await call.ResponseAsync.ConfigureAwait(false);
2323
}
2424

25+
/// <summary>
26+
/// Resets a projection. This will re-emit events. Streams that are written to from the projection will also be soft deleted.
27+
/// </summary>
28+
/// <param name="name"></param>
29+
/// <param name="userCredentials"></param>
30+
/// <param name="cancellationToken"></param>
31+
/// <returns></returns>
32+
public async Task ResetAsync(string name, UserCredentials? userCredentials = null,
33+
CancellationToken cancellationToken = default) {
34+
using var call = _client.ResetAsync(new ResetReq {
35+
Options = new ResetReq.Types.Options {
36+
Name = name,
37+
WriteCheckpoint = true
38+
}
39+
}, EventStoreCallOptions.Create(Settings, Settings.OperationOptions, userCredentials, cancellationToken));
40+
await call.ResponseAsync.ConfigureAwait(false);
41+
}
42+
2543
/// <summary>
2644
/// Aborts a projection. Saves the projection's checkpoint.
2745
/// </summary>

0 commit comments

Comments
 (0)