public IHttpActionResult Get()
        {
            var episode = _episodeRepository.GetAll().Cast <Episode>();

            if (episode == null || !episode.Any())
            {
                return(NotFound());
            }

            return(Ok(episode));
        }
示例#2
0
        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();
            }
        }
示例#3
0
 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));
        }
示例#5
0
 public List <Episode> GetAllEpisodesFromPodcast(int index)
 {
     return(episodeRepository.GetAll(index));
 }