public IHttpActionResult Get() { var episode = _episodeRepository.GetAll().Cast <Episode>(); if (episode == null || !episode.Any()) { return(NotFound()); } return(Ok(episode)); }
private void AddEpisode(object parameter) { _episodeOperation.Status = EpisodeOperation.OperationStatus.OKAY; EpisodeRepository episodeRepository = new EpisodeRepository(); List <Episode> episodes = new List <Episode>(episodeRepository.GetAll()); NewEpisode.Id = (episodes.Count() + 1); EpisodeBusiness episodeBusiness = new EpisodeBusiness(); episodeBusiness.AddEpisode(NewEpisode); if (parameter is System.Windows.Window) { (parameter as System.Windows.Window).Close(); } }
public static List <Episode> GetAll() { try { List <Episode> result; using (var context = new MediaManagerContext()) using (var repository = new EpisodeRepository(context)) { result = repository.GetAll(); } return(result); } catch (Exception ex) { throw new MediaManagerException($"Erreur : {ex.Message}", ExceptionReturnType.Error); } }
public ActionResult Find() { var results = _episodeRepository.GetAll(); return(PartialView("_gridResultsPanel", results)); }
public List <Episode> GetAllEpisodesFromPodcast(int index) { return(episodeRepository.GetAll(index)); }