public void DeleteAlbumReview(int albumReviewId)
 {
     using (var uow = UnitOfWorkProvider.Create())
     {
         _albumReviewRepository.Delete(albumReviewId);
         uow.Commit();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Delets the review
        /// </summary>
        /// <param name="reviewID">ID of review to delete</param>
        public void DeleteAlbumReview(int reviewID)
        {
            if (reviewID < 1)
            {
                throw new ArgumentOutOfRangeException("AlbumReview service - DeleteAlbumReview(...) reviewID cannot be lesser than 1");
            }

            using (var uow = UnitOfWorkProvider.Create())
            {
                var review = albumReviewRepository.GetByID(reviewID);
                if (review == null)
                {
                    throw new NullReferenceException("Album review service - DeleteAlbumReview(...) review to be deleted is null(could not be found)");
                }
                albumReviewRepository.Delete(review);
                uow.Commit();
            }
        }