public ActionResult <AlbumDto> GetAlbum(Guid albumId) { var album = _repository.GetAlbum(albumId); if (album == null) { return(NotFound()); } return(Ok(_mapper.Map <AlbumDto>(album))); }
public ActionResult <AlbumDTO> GetAlbumForBand(Guid bandId, Guid albumId) { if (!_bandAlbumRepository.BandExists(bandId)) { return(NotFound()); } Album album = _bandAlbumRepository.GetAlbum(bandId, albumId); if (album == null) { return(NotFound()); } return(Ok(_mapper.Map <Album, AlbumDTO>(album))); }
public ActionResult <AlbumDto> GetAlbum(Guid bandId, Guid albumId) { if (!_repository.BandExists(bandId)) { return(NotFound()); } var albumForRepo = _repository.GetAlbum(bandId, albumId); if (albumForRepo == null) { return(NotFound()); } return(Ok(_mapper.Map <AlbumDto>(albumForRepo))); }
public ActionResult<AlbumDto> GetAlbumForBand(Guid bandId, Guid albumId) { if (!_bandAlbumRepository.BandExists(bandId)) { return NotFound(); } Entities.Album album = _bandAlbumRepository.GetAlbum(bandId, albumId); if (album == null) { return NotFound(); } return Ok(_mapper.Map<AlbumDto>(album)); }
public ActionResult <AlbumDto> GetAlbumForBand(Guid bandID, Guid albumID) { if (!_bandAlbumRepository.BandExists(bandID)) { return(NotFound()); } var albumFromRepo = _bandAlbumRepository.GetAlbum(bandID, albumID); if (albumFromRepo == null) { return(NotFound()); } return(new OkObjectResult(_mapper.Map <AlbumDto>(albumFromRepo))); }
public ActionResult <AlbumDto> GetAlbumForBand(Guid bandId, Guid albumId) { if (!_bandAlbumRepository.BandExists(bandId)) { return(StatusCode(StatusCodes.Status404NotFound)); } var albumForBand = _bandAlbumRepository.GetAlbum(bandId, albumId); if (albumForBand == null) { return(StatusCode(StatusCodes.Status404NotFound)); } return(StatusCode(StatusCodes.Status200OK, _mapper.Map <AlbumDto>(albumForBand))); }
public async Task <ActionResult <AlbumDto> > GetAlbumForBand(Guid bandId, Guid albumId) { if (!await _bandAlbumRepository.BandExists(bandId)) { return(NotFound()); } //if (!_bandAlbumRepository.AlbumExists(albumId)) // return NotFound(); var albumFromRepo = await _bandAlbumRepository.GetAlbum(bandId, albumId); if (albumFromRepo == null) { return(NotFound()); } return(Ok(_mapper.Map <AlbumDto>(albumFromRepo))); }
public ActionResult <AlbumsDTO> GetAlbumForBand(Guid bandId, Guid albumId) { //if (!_bandAlbumRepository.BandExists(bandId)) // return NotFound(); var albumFromRepo = _bandAlbumRepository.GetAlbum(bandId, albumId); if (albumFromRepo == null) { return(NotFound()); } return(Ok(_mapper.Map <AlbumsDTO>(albumFromRepo))); }
public ActionResult <AlbumDto> GetAlbumForBand(Guid bandId, Guid albumId) { if (!_bandAlbumRepository.BandExists(bandId)) { var AlbumFromPro = _bandAlbumRepository.GetAlbum(bandId, albumId); if (AlbumFromPro != null) { return(Ok(_mapper.Map <AlbumDto>(AlbumFromPro))); } return(NotFound()); } return(NotFound()); }