public IActionResult EditRecord(MummyModel formsubmission) { if (ModelState.IsValid) { _context.Mummy.Update(formsubmission); _context.SaveChanges(); return(View("EditConfirmation", formsubmission)); } else { return(View(formsubmission)); } }
public IActionResult RemoveRecord(MummyModel formsubmission) { //instantiate a querable movie object equal to the DBcontextfile where the movie ID equals the passed in form IQueryable <MummyModel> queryable = _context.Mummy.Where(p => p.MummyID == formsubmission.MummyID); //Loop through the querable object and remove all data where those MovieIDs match foreach (var x in queryable) { _context.Mummy.Remove(x); } _context.SaveChanges(); //Return the delete confirmation page return(View("DeleteConfirmation")); }
public IActionResult ViewRecords(MummyModel formsubmission) { return(View("EditRecord", formsubmission)); }