コード例 #1
0
ファイル: ArtistService.cs プロジェクト: Fredo182/MusicApp
        public async Task <IEnumerable <ArtistModel> > GetArtistsAsync(ArtistFilterModel filter = null, IEnumerable <ArtistOrderByModel> orderByList = null, string includes = "", bool tracking = true)
        {
            var f = ArtistFilterExpressions(_mapper.Map <ArtistFilter>(filter));
            var o = ArtistOrderByList(_mapper.Map <IEnumerable <ArtistOrderBy> >(orderByList));
            var a = await _unitOfWork.Artists.GetAsync(f, o, includes, tracking);

            return(_mapper.Map <IEnumerable <ArtistModel> >(a));
        }
コード例 #2
0
ファイル: ArtistService.cs プロジェクト: Fredo182/MusicApp
        public async Task <PaginationResultModel <ArtistModel> > GetPagedArtistsAsync(PaginationModel pagination, ArtistFilterModel filter = null, IEnumerable <ArtistOrderByModel> orderByList = null, string includes = "", bool tracking = true)
        {
            var p = _mapper.Map <Pagination>(pagination);
            var f = ArtistFilterExpressions(_mapper.Map <ArtistFilter>(filter));
            var o = ArtistOrderByList(_mapper.Map <IEnumerable <ArtistOrderBy> >(orderByList));
            var a = await _unitOfWork.Artists.GetPagedAsync(p, f, o, includes, tracking);

            var result = new PaginationResultModel <ArtistModel>(_mapper.Map <PaginationStateModel>(a.PageState), _mapper.Map <IEnumerable <ArtistModel> >(a.Result));

            return(result);
        }
コード例 #3
0
ファイル: ArtistService.cs プロジェクト: Fredo182/MusicApp
 public async Task <PaginationResultModel <ArtistModel> > GetPagedArtistsAlbumsSongsAsync(PaginationModel pagination, ArtistFilterModel filter = null, IEnumerable <ArtistOrderByModel> orderByList = null, bool tracking = true)
 {
     return(await this.GetPagedArtistsAsync(pagination, filter, orderByList, "Albums,Albums.Songs", tracking));
 }
コード例 #4
0
ファイル: ArtistService.cs プロジェクト: Fredo182/MusicApp
 public async Task <IEnumerable <ArtistModel> > GetArtistsAlbumsSongsAsync(ArtistFilterModel filter = null, IEnumerable <ArtistOrderByModel> orderByList = null, bool tracking = true)
 {
     return(await this.GetArtistsAsync(filter, orderByList, "Albums,Albums.Songs", tracking));
 }