Beispiel #1
0
        internal virtual DeleteActivityResponse DeleteActivity(DeleteActivityRequest request)
        {
            var marshaller   = new DeleteActivityRequestMarshaller();
            var unmarshaller = DeleteActivityResponseUnmarshaller.Instance;

            return(Invoke <DeleteActivityRequest, DeleteActivityResponse>(request, marshaller, unmarshaller));
        }
Beispiel #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteActivity operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteActivity 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/states-2016-11-23/DeleteActivity">REST API Reference for DeleteActivity Operation</seealso>
        public virtual Task <DeleteActivityResponse> DeleteActivityAsync(DeleteActivityRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new DeleteActivityRequestMarshaller();
            var unmarshaller = DeleteActivityResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteActivityRequest, DeleteActivityResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteActivity operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeleteActivity 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/states-2016-11-23/DeleteActivity">REST API Reference for DeleteActivity Operation</seealso>
        public virtual Task <DeleteActivityResponse> DeleteActivityAsync(DeleteActivityRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteActivityRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteActivityResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteActivityResponse>(request, options, cancellationToken));
        }
        internal virtual DeleteActivityResponse DeleteActivity(DeleteActivityRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteActivityRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteActivityResponseUnmarshaller.Instance;

            return(Invoke <DeleteActivityResponse>(request, options));
        }
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                var deleteTraining = new DeleteActivityRequest()
                {
                    Username   = User.Identity.Name,
                    IdActivity = id
                };
                await SendCommand(deleteTraining);

                return(RedirectToAction("Run", "Runner", new { id = id }));
            }
            catch
            {
                return(RedirectToAction(nameof(Index), new { id = id }));
            }
        }
Beispiel #6
0
        public override async Task <ActivityResponse> DeleteActivity(DeleteActivityRequest req, ServerCallContext context)
        {
            try
            {
                await _activityManager.DeleteActivityAsync(req.ActivityId);

                return(new ActivityResponse
                {
                    Message = $"Successfully deleted given activity: {req.ActivityId}",
                    Status = ResponseStatus.Success
                });
            }
            catch (Exception ex)
            {
                return(new ActivityResponse
                {
                    Message = $"Failed to delete given activity: ActivityId = {req.ActivityId}, Error = {ex.Message}",
                    Status = ResponseStatus.Failed
                });
            }
        }