예제 #1
0
        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();
        }
예제 #2
0
 public void RemoveWorkout(int id)
 {
     repo.RemoveWorkout(id);
 }