public ActionResult <List <Song> > GetAllSongs() { Debug.WriteLine($"{MethodBase.GetCurrentMethod().Name} requested"); var songs = _songManager.GetAll().ToList(); Debug.WriteLine($"returning {songs.Count} songs"); return(new ActionResult <List <Song> >(songs)); }
public List <SongVM> Get() { return(_songRepository.GetAll().Select(x => new SongVM { Id = x.Id, DisplayName = x.DisplayName, AlbumId = x.AlbumId, ArtistId = x.ArtistId, }).ToList()); }
public void Index_Model_Is_Expected_Model() { var expectedModel = new List <Song>(); repo.GetAll().Returns(expectedModel); var result = underTest.Index(); var model = (IEnumerable <Song>)result.Model; Assert.Equal(expectedModel, model); }
public IActionResult GetAllSongs(bool?isPopular) { var songs = _songRepository.GetAll().ToList(); if (isPopular.HasValue) { songs = songs.FindAll(x => x.IsPopular == isPopular); } var allSongsDto = songs.Select(x => Mapper.Map <SongDto>(x)); return(Ok(allSongsDto)); }
public async Task <State> ExecuteAsync(GetStateQuery command, State previousResult) { var currentSong = await _currentSongRepository.FirstOrDefault(); var queue = await _songRepository.GetAll("SELECT * FROM c where c.finished = false"); if (currentSong != null) { queue = queue.Where(x => x.Id != currentSong.SongId); } var state = new State() { CurrentSong = currentSong, Queue = queue.ToList() }; return(state); }
public ViewResult Index() { IEnumerable <Song> model = songRepo.GetAll(); return(View(model)); }
public async Task <OperationResult <IEnumerable <SongDTO> > > GetAll() { var songs = await songRepository.GetAll(); return(OperationResult <IEnumerable <SongDTO> > .CreateSuccessResult(mapper.Map <IEnumerable <SongDTO> >(songs))); }
public ViewResult Index() { var model = repo.GetAll(); return(View(model)); }
public IActionResult GetAll() { return(Ok(_songRepository.GetAll())); }
public IEnumerable <Song> GetAll() { return(_songRepository.GetAll()); }
public ActionResult Index() { var songs = _songRepository.GetAll(); return(View(songs)); }
public ActionResult <IEnumerable <Song> > Get() { return(ISongRepository.GetAll()); }
// GET: SongsController public ActionResult Index() { return(View(_songRepository.GetAll())); }
public async Task <IEnumerable <Song> > ExecuteAsync(GetSongsQuery command, IEnumerable <Song> previousResult) { return(await _songRepository.GetAll()); }