public async Task <IActionResult> Edit(int id, [Bind("Id,AgentId,RatingDate,RatingTypeId,Score")] AgentSelfRating agentSelfRating) { if (id != agentSelfRating.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(agentSelfRating); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AgentSelfRatingExists(agentSelfRating.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(agentSelfRating)); }
public async Task <IActionResult> Create([Bind("Id,AgentId,RatingDate,RatingTypeId,Score")] AgentSelfRating agentSelfRating) { if (ModelState.IsValid) { _context.Add(agentSelfRating); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(agentSelfRating)); }