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