public IActionResult GetSongCollection( [ModelBinder(BinderType = typeof(ArrayModelBinder))] IEnumerable <Guid> ids) { if (ids == null) { return(BadRequest()); } var songEntities = _sprotifyRepository.GetSongs(ids); if (ids.Count() != songEntities.Count()) { return(NotFound()); } return(Ok(Mapper.Map <IEnumerable <Models.Song> >(songEntities))); }
public IActionResult GetSongs([FromQuery] string search = null) { var songs = _sprotifyRepository.GetSongs(search); return(Ok(Mapper.Map <IEnumerable <Song> >(songs))); }