public IEnumerable <SongReviewDTO> ListSongReviews(SongReviewFilter filter)
 {
     using (UnitOfWorkProvider.Create())
     {
         _songReviewListQuery.Filter = filter;
         return(_songReviewListQuery.Execute() ?? new List <SongReviewDTO>());
     }
 }
Пример #2
0
        public IEnumerable <SongReviewDTO> ListSongReviews(SongReviewFilter filter)
        {
            using (UnitOfWorkProvider.Create())
            {
                _songReviewListQuery.Filter = filter;

                var sortSongReviews = filter.SortAscending ? SortDirection.Ascending : SortDirection.Descending;
                _albumReviewListQuery.AddSortCriteria("Rating", sortSongReviews);
                return(_songReviewListQuery.Execute());
            }
        }
Пример #3
0
        public IEnumerable <SongReviewDTO> GetSongReviews(int songID)
        {
            if (songID < 1)
            {
                throw new ArgumentOutOfRangeException("Song service - GetSongReviews(...) songID cannot be lesser than 1");
            }

            using (UnitOfWorkProvider.Create())
            {
                songReviewListQuery.Filter = new SongReviewFilter {
                    SongID = songID
                };
                return(songReviewListQuery.Execute());
            }
        }