コード例 #1
0
        internal virtual UpdateBranchResponse UpdateBranch(UpdateBranchRequest request)
        {
            var marshaller   = UpdateBranchRequestMarshaller.Instance;
            var unmarshaller = UpdateBranchResponseUnmarshaller.Instance;

            return(Invoke <UpdateBranchRequest, UpdateBranchResponse>(request, marshaller, unmarshaller));
        }
コード例 #2
0
        public async Task <IActionResult> UpdateBranch(int branchId, [FromBody] UpdateBranchRequest request)
        {
            var updatebranchCommand = new UpdateBranchCommand(branchId, request);
            var result = await mediator.Send(updatebranchCommand);

            return(StatusCode((int)result.Code, result.Value));
        }
コード例 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateBranch operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the UpdateBranch operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/UpdateBranch">REST API Reference for UpdateBranch Operation</seealso>
        public virtual Task <UpdateBranchResponse> UpdateBranchAsync(UpdateBranchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = UpdateBranchRequestMarshaller.Instance;
            var unmarshaller = UpdateBranchResponseUnmarshaller.Instance;

            return(InvokeAsync <UpdateBranchRequest, UpdateBranchResponse>(request, marshaller,
                                                                           unmarshaller, cancellationToken));
        }
コード例 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateBranch operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the UpdateBranch operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/UpdateBranch">REST API Reference for UpdateBranch Operation</seealso>
        public virtual Task <UpdateBranchResponse> UpdateBranchAsync(UpdateBranchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UpdateBranchRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UpdateBranchResponseUnmarshaller.Instance;

            return(InvokeAsync <UpdateBranchResponse>(request, options, cancellationToken));
        }
コード例 #5
0
        internal virtual UpdateBranchResponse UpdateBranch(UpdateBranchRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = UpdateBranchRequestMarshaller.Instance;
            options.ResponseUnmarshaller = UpdateBranchResponseUnmarshaller.Instance;

            return(Invoke <UpdateBranchResponse>(request, options));
        }
コード例 #6
0
        public async Task <APIResponse> UpdateBranch(int branchId, UpdateBranchRequest request)
        {
            try
            {
                var client = httpClientFactory.CreateClient(VendorServiceOperation.serviceName);

                var         param       = JsonConvert.SerializeObject(request);
                HttpContent contentPost = new StringContent(param, Encoding.UTF8, "application/json");

                var response = await client.PutAsync(servicesConfig.Vendor + VendorServiceOperation.UpdateBranch(branchId), contentPost);

                return(new APIResponse(response.StatusCode));
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception in method 'UpdateBranch()'");
                var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
                return(new APIResponse(exMessage, HttpStatusCode.InternalServerError));
            }
        }
コード例 #7
0
        public async Task <ActionResult <UpdateBranchResponse> > Update(UpdateBranchRequest request)
        {
            var response = _mediator.Send(request);

            return(Ok());
        }
コード例 #8
0
        public async Task <IActionResult> UpdateBranch(int branchId, [FromBody] UpdateBranchRequest request)
        {
            var result = await branchService.UpdateBranch(branchId, request);

            return(StatusCode((int)result.Code, result.Value));
        }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateBranchCommand"/> class.
 /// </summary>
 /// <param name="branchRequest">The servicequestionrequest.</param>
 public UpdateBranchCommand(int branchId, UpdateBranchRequest branchRequest)
 {
     Id            = branchId;
     BranchRequest = branchRequest;
 }