public ActionResult Search(string search) { List <Animes> Animes = contextEF.Anime.ToList(); var result1 = contextEF.Anime.Where(f => f.Nom.ToLower().Contains(search.ToLower())).OrderBy(x => x.Nom); var vm = new ListeViewModels(); using (var context = new MangaEntities()) { foreach (var f in result1) { var dto = new Animes { Nom = f.Nom, Image = f.Image, Genres = f.Genres, Synopsis = f.Synopsis }; vm.ListAnimes.Add(dto); } } return(View(vm)); }
public ActionResult ButtonPressed(string magicButton) { List <Animes> Anime = contextEF.Anime.ToList(); var result = contextEF.Anime.Where(f => f.Nom.StartsWith(magicButton)).OrderBy(x => x.Nom); if (magicButton == "0") { result = contextEF.Anime.Where(f => f.Id < 3).OrderBy(x => x.Nom); } var vm = new ListeViewModels(); using (var context = new MangaEntities()) { foreach (var f in result) { var dto = new Animes { Nom = f.Nom, Image = f.Image, Genres = f.Genres, Synopsis = f.Synopsis }; vm.ListAnimes.Add(dto); } } return(View(vm)); }
public ActionResult Index() { List <Animes> Animes = contextEF.Anime.ToList(); var vm = new ListeViewModels(); using (var context = new MangaEntities()) { var result1 = context.Anime.Where(f => f.Motif == "En Cours").OrderBy(x => x.Nom); foreach (var f in result1) { var dto = new Animes { Nom = f.Nom, Image = f.Image }; vm.ListAnimes.Add(dto); } } return(View(vm)); }
public ActionResult Index() { List <Animes> Animes = contextEF.Anime.ToList(); var result = contextEF.Anime.Where(f => f.Id < 3).OrderBy(x => x.Nom); var vm = new ListeViewModels(); using (var context = new MangaEntities()) { foreach (var f in result) { var dto = new Animes { Nom = f.Nom, Image = f.Image, Genres = f.Genres, Synopsis = f.Synopsis }; vm.ListAnimes.Add(dto); } } return(View(vm)); }