Пример #1
0
        public Task <ActionResult> PostUserAsync(PostUserParameters parameters, [FromServices] IPostUserHandler handler, CancellationToken cancellationToken)
        {
            if (handler is null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            return(InvokePostUserAsync(parameters, handler, cancellationToken));
        }
        public Task <PostUserResult> ExecuteAsync(PostUserParameters parameters, CancellationToken cancellationToken = default)
        {
            if (parameters is null)
            {
                throw new System.ArgumentNullException(nameof(parameters));
            }

            return(InvokeExecuteAsync(parameters, cancellationToken));
        }
Пример #3
0
 private static async Task <ActionResult> InvokePostUserAsync(PostUserParameters parameters, IPostUserHandler handler, CancellationToken cancellationToken)
 {
     return(await handler.ExecuteAsync(parameters, cancellationToken));
 }
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
        private async Task <PostUserResult> InvokeExecuteAsync(PostUserParameters parameters, CancellationToken cancellationToken)
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
        {
            throw new System.NotImplementedException();
        }
Пример #5
0
 public Task <PostUserResult> ExecuteAsync(PostUserParameters parameters, CancellationToken cancellationToken = default)
 {
     return(Task.FromResult(PostUserResult.Created()));
 }
Пример #6
0
 private async Task <PostUserResult> InvokeExecuteAsync(PostUserParameters parameters, CancellationToken cancellationToken)
 {
     return(await Task.FromResult(PostUserResult.Created()));
 }