public IActionResult Index() { var config = Startup.Configuration; TitresViewModel titresViewModel = new TitresViewModel(); titresViewModel.TitresRecent = Startup.ititreRepository.FindTitresReçent(Int32.Parse(config["TitresRecent"])).ToList(); titresViewModel.TitresPlusEcoutes = Startup.ititreRepository.FindTitresPopulaires(Int32.Parse(config["TitresPlusEcoutes"])).ToList(); return(this.View(titresViewModel)); }
public IActionResult Delete(int id) { try { Titre titre = _titreRepository.Find(id); TitresViewModel vm = new TitresViewModel { IdTitre = titre.IdTitre, NomTitre = titre.Libelle }; return(this.View(nameof(TitresController.Delete), vm)); } catch (NullReferenceException e) { return(RedirectToAction(nameof(TitresController.Index), "Titres", new { area = "Administration" })); } }
public IViewComponentResult Invoke(TitresViewModel titre) { return(View(titre)); }