public async Task<IActionResult> Edit(Species species) { if (ModelState.IsValid) { context.Update(species); await context.SaveChangesAsync(); return RedirectToAction("Index"); } return View(species); }
public async Task<IActionResult> Create(Species species) { if (ModelState.IsValid) { species.Id = Guid.NewGuid(); context.Species.Add(species); await context.SaveChangesAsync(); return RedirectToAction("Index"); } return View(species); }