public IActionResult EditGenre(string id) { var genre = new EditGenreInputModel { Name = this.genresService.GetGenreName(id), }; return(this.View(genre)); }
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(); }
public async Task <IActionResult> EditGenre(EditGenreInputModel input) { await this.genresService.EditGenre(input); return(this.RedirectToAction("AllGenres")); }