public async Task RemoveWorkoutAsync(int workoutId) { var workout = await _workoutRepo.GetWorkoutWithLikesAsync(workoutId); if (workout.UsersThatLiked.Count > 0) { var deletedUser = await _userRepo.GetUserByNameAsync("deleted"); workout.AppUserId = deletedUser.Id; } else { _workoutRepo.RemoveWorkout(workout); } await _unitOfWork.SaveAllAsync(); }
public void RemoveWorkout(int id) { repo.RemoveWorkout(id); }