/// <summary> /// Delete an entry part of a workout in the edit page. /// </summary> /// <param name="entryId"> Id of workout entry. </param> /// <param name="workoutId"> Id of workout. </param> /// <returns> Edit page of workout. </returns> public async Task <IActionResult> DeleteEntry(int entryId, int workoutId) { var user = await GetCurrentUserAsync(); var isSuccess = await _workoutService.DeleteWorkoutEntryAsync(user.Id, entryId); if (!isSuccess) { return(View("/Error")); // Error } return(RedirectToAction(nameof(EditWorkout), new RouteValueDictionary( new { controller = "Workout", action = nameof(EditWorkout), id = workoutId }))); // new { controller = "Workout", action = nameof(EditWorkout), id = workoutId })); }