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