示例#1
0
        public IActionResult Index(string keywords)
        {
            var titres   = _titreRepository.Search(keywords).ToList();
            var artistes = _artisteRepository.Search(keywords).ToList();

            var model = new RechercheViewModel {
                Keywords = keywords, Artistes = artistes, Titres = titres
            };

            return(this.View(model));
        }
示例#2
0
        public IActionResult Index(string mot)
        {
            List <Artiste> a = new List <Artiste>();
            List <Titre>   t = new List <Titre>();

            if (mot != null && mot != "")
            {
                a = (List <Artiste>)_artisteRepository.Search(mot);
                t = (List <Titre>)_titreRepository.Search(mot);
            }

            ResearchViewModel recherche = new ResearchViewModel()
            {
                Titres    = t,
                Artistes  = a,
                Recherche = mot
            };

            this.ViewData.Model = recherche;
            return(View());
        }