Example #1
0
        public IActionResult EditGenre(string id)
        {
            var genre = new EditGenreInputModel
            {
                Name = this.genresService.GetGenreName(id),
            };

            return(this.View(genre));
        }
Example #2
0
        public async Task EditGenre(EditGenreInputModel input)
        {
            var genre = this.genresRepository.All().FirstOrDefault(g => g.Id == input.Id);

            if (genre == null)
            {
                throw new ArgumentNullException("WTF BRO");
            }

            genre.Name = input.Name;
            await this.genresRepository.SaveChangesAsync();
        }
Example #3
0
        public async Task <IActionResult> EditGenre(EditGenreInputModel input)
        {
            await this.genresService.EditGenre(input);

            return(this.RedirectToAction("AllGenres"));
        }