public async Task <IActionResult> PutApplicant(int id, Applicant applicant) { _logger.LogInformation("{0} called with id {1}.", nameof(PutApplicant), id); if (id != applicant.Id) { return(BadRequest()); } _context.Entry(applicant).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApplicantExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
// GET: Applicants public ActionResult Index() { List <Applicant> apps = db.Applicants.ToList(); foreach (var a in apps) { //if (a.gradesEntered()) //{ a.calculateAll(); a.name = GetName(a.Id); db.Entry(a).State = EntityState.Modified; db.SaveChanges(); //} } return(View(apps)); }