public async Task <IActionResult> Delete(Guid workoutId)
        {
            User user = _userService.GetByEmail(User.Identity.Name);

            _workoutService.DeleteWorkout(user, workoutId);

            return(Ok(workoutId));
        }
        public IActionResult Delete(DeleteWorkoutViewModel viewModel)
        {
            try
            {
                _workoutService.DeleteWorkout(viewModel.Id);
            }
            catch (InvalidOperationException ex)
            {
                return(this.View("Error", new ErrorViewModel {
                    Message = ex.Message
                }));
            }

            return(Redirect($"/Users/ViewProfile?username={this.User.Identity.Name}"));
        }