public AlbumReviewDTO GetAlbumReview(int albumReviewId) { if (albumReviewId < 1) { throw new ArgumentOutOfRangeException("AlbumReview service - GetAlbumReview(...) albumReviewId cannot be lesser than 1"); } using (UnitOfWorkProvider.Create()) { var albumReview = albumReviewRepository.GetByID(albumReviewId); return(albumReview != null?Mapper.Map <AlbumReviewDTO>(albumReview) : null); } }
/// <summary> /// Gets the albumReview according to the ID /// </summary> /// <param name="albumReviewId">The album Review id</param> /// <returns>album Review according to ID</returns> private AlbumReview GetAlbumReview(int albumReviewId) { if (albumReviewId < 1) { throw new ArgumentOutOfRangeException("Album service - GetAlbumReview(...) albumReviewId cannot be lesser than 1"); } var albumReview = albumReviewRepository.GetByID(albumReviewId); if (albumReview == null) { throw new NullReferenceException("Album service - GetAlbumReview (...) album Review cant be null"); } return(albumReview); }