Ejemplo n.º 1
0
 public IActionResult AddMovie(string id)
 {
     if (string.IsNullOrEmpty(id))
     {
         return(NotFound());
     }
     if (Top10Id == null || Top10Id == "")
     {
         var top          = AdministrationRepository.GetTop();
         var movieOnTop10 = new MovieOnTop10
         {
             MovieId        = id,
             Top10Id        = top.Top10Id,
             Top10          = top,
             MovieOnTop10Id = Guid.NewGuid().ToString()
         };
         AdministrationRepository.AddMovieOnTop10(movieOnTop10);
     }
     else
     {
         var movieOnTop10 = new MovieOnTop10
         {
             MovieId        = id,
             Top10Id        = Top10Id,
             MovieOnTop10Id = Guid.NewGuid().ToString()
         };
         AdministrationRepository.AddMovieOnTop10(movieOnTop10);
     }
     return(RedirectToAction("GetTop10"));
 }