Exemplo n.º 1
0
        public IActionResult Edit(MangaEditViewModel model)
        {
            if (ModelState.IsValid)
            {
                Manga manga = _mangaRepository.GetManga(model.Id);
                manga.Title    = model.Title;
                manga.Summary  = model.Summary;
                manga.ImageUrl = model.ImageUrl;
                _mangaRepository.UpdateManga(manga);
                return(RedirectToAction("Panel", "Account"));
            }

            return(View());
        }
Exemplo n.º 2
0
        public IActionResult Edit(int id)
        {
            Manga manga = _mangaRepository.GetManga(id);

            if (manga == null)
            {
                return(View("404Error"));
            }

            MangaEditViewModel model = new MangaEditViewModel()
            {
                Id       = manga.Id,
                Title    = manga.Title,
                Summary  = manga.Summary,
                ImageUrl = manga.ImageUrl
            };

            return(View(model));
        }