コード例 #1
0
 public async Task UpdateProjectionDesiredState(
     ConnectedProjectionIdentifier projection,
     UserDesiredState userDesiredState,
     CancellationToken cancellationToken)
 => await _context.UpdateProjectionDesiredState(
     projection,
     userDesiredState,
     CancellationToken.None);
コード例 #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);
     }
 }
コード例 #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);
        }