public async Task UpdateProjectionDesiredState( ConnectedProjectionIdentifier projection, UserDesiredState userDesiredState, CancellationToken cancellationToken) => await _context.UpdateProjectionDesiredState( projection, userDesiredState, CancellationToken.None);
public async Task UpdateUserDesiredState(UserDesiredState userDesiredState, CancellationToken cancellationToken) { await using (var ctx = ContextFactory().Value) { await ctx.UpdateProjectionDesiredState(Name, userDesiredState, cancellationToken); await ctx.SaveChangesAsync(cancellationToken); } }
public async Task <UserDesiredState?> GetProjectionDesiredState( ConnectedProjectionIdentifier projection, CancellationToken cancellationToken) { var projectionState = await GetProjectionState(projection, cancellationToken); return(UserDesiredState.TryParse(projectionState?.DesiredState ?? string.Empty, out var state) ? state : null); }