コード例 #1
0
        public async Task UpdateAsync(string name, string query, bool?emitEnabled = null,
                                      UserCredentials?userCredentials             = null, CancellationToken cancellationToken = default)
        {
            var options = new UpdateReq.Types.Options {
                Name  = name,
                Query = query
            };

            if (emitEnabled.HasValue)
            {
                options.EmitEnabled = emitEnabled.Value;
            }
            else
            {
                options.NoEmitOptions = new Empty();
            }

            using var call = _client.UpdateAsync(new UpdateReq {
                Options = options
            }, EventStoreCallOptions.Create(Settings, Settings.OperationOptions, userCredentials, cancellationToken));

            await call.ResponseAsync.ConfigureAwait(false);
        }
        public async Task UpdateAsync(string name, string query, bool?emitEnabled = null,
                                      UserCredentials userCredentials             = default, CancellationToken cancellationToken = default)
        {
            var options = new UpdateReq.Types.Options {
                Name  = name,
                Query = query
            };

            if (emitEnabled.HasValue)
            {
                options.EmitEnabled = emitEnabled.Value;
            }
            else
            {
                options.NoEmitOptions = new Empty();
            }

            using var call = _client.UpdateAsync(new UpdateReq {
                Options = options
            },
                                                 RequestMetadata.Create(userCredentials), cancellationToken: cancellationToken);

            await call.ResponseAsync.ConfigureAwait(false);
        }