コード例 #1
0
        public async Task <IActionResult> GetAlbumForBandById(Guid bandId, Guid id, bool includeSongs = false)
        {
            if (!await _service.BandExists(bandId))
            {
                return(NotFound());
            }

            if (!await _service.AlbumExists(id))
            {
                return(NotFound());
            }

            if (includeSongs)
            {
                return(Ok(_mapper.Map <AlbumWithSongs>(await _service.GetAlbumById(id, includeSongs))));
            }

            return(Ok(_mapper.Map <Album>(await _service.GetAlbumById(id, false))));
        }