public async Task <IActionResult> Edit(int id, [Bind("PGRatingId,Rating")] PGRating pGRating) { if (id != pGRating.PGRatingId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pGRating); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PGRatingExists(pGRating.PGRatingId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(pGRating)); }
public async Task <IActionResult> Create([Bind("PGRatingId,Rating")] PGRating pGRating) { if (ModelState.IsValid) { _context.Add(pGRating); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pGRating)); }