예제 #1
0
        public Task <ActionResult> UpdateUserByIdAsync(UpdateUserByIdParameters parameters, [FromServices] IUpdateUserByIdHandler handler, CancellationToken cancellationToken)
        {
            if (handler is null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            return(InvokeUpdateUserByIdAsync(parameters, handler, cancellationToken));
        }
예제 #2
0
        public Task <UpdateUserByIdResult> ExecuteAsync(UpdateUserByIdParameters parameters, CancellationToken cancellationToken = default)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            return(InvokeExecuteAsync(parameters, cancellationToken));
        }
예제 #3
0
 private static async Task <ActionResult> InvokeUpdateUserByIdAsync(UpdateUserByIdParameters parameters, IUpdateUserByIdHandler handler, CancellationToken cancellationToken)
 {
     return(await handler.ExecuteAsync(parameters, cancellationToken));
 }
예제 #4
0
 public Task <UpdateUserByIdResult> ExecuteAsync(UpdateUserByIdParameters parameters, CancellationToken cancellationToken = default)
 {
     return(Task.FromResult(UpdateUserByIdResult.Ok("Hallo world")));
 }
예제 #5
0
 private async Task <UpdateUserByIdResult> InvokeExecuteAsync(UpdateUserByIdParameters parameters, CancellationToken cancellationToken)
 {
     return(await Task.FromResult("We are now updated."));
 }
예제 #6
0
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
        private async Task <UpdateUserByIdResult> InvokeExecuteAsync(UpdateUserByIdParameters parameters, CancellationToken cancellationToken)
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
        {
            throw new System.NotImplementedException();
        }