Example #1
0
 public async Task UpdateProjectionDesiredState(
     ConnectedProjectionIdentifier projection,
     UserDesiredState userDesiredState,
     CancellationToken cancellationToken)
 => await _context.UpdateProjectionDesiredState(
     projection,
     userDesiredState,
     CancellationToken.None);
Example #2
0
 public async Task UpdateUserDesiredState(UserDesiredState userDesiredState, CancellationToken cancellationToken)
 {
     await using (var ctx = ContextFactory().Value)
     {
         await ctx.UpdateProjectionDesiredState(Name, userDesiredState, cancellationToken);
         await ctx.SaveChangesAsync(cancellationToken);
     }
 }
Example #3
0
        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);
        }