public async Task DeleteUserPhotoCommentsByPhotoId(int photoId) { var userPhoto = await _getUserPhotoBusiness.GetUserPhotoByPhotoId(photoId); var listComments = await _getUserPhotoCommentsBusiness.GetUserPhotoCommentsByUserPhotoId(userPhoto.Id); foreach (Entities.UserPhotoComment comment in listComments) { _commentRepository.DeleteUserPhotoComment(comment); } }
public async Task DeleteUserPhotoByPhotoId(int PhotoId) { var userPhoto = await _getPhoto.GetUserPhotoByPhotoId(PhotoId); _photoRepository.DeleteUserPhoto(userPhoto); }