public ActionResult DeleteConfirmed(int id) { CovidCount covidCount = db.CovidCount.Find(id); db.CovidCount.Remove(covidCount); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Day,TotalCases,Confirmed,Recovered,Deaths")] CovidCount covidCount) { if (ModelState.IsValid) { db.Entry(covidCount).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(covidCount)); }
public ActionResult Create([Bind(Include = "Id,Day,TotalCases,Confirmed,Recovered,Deaths")] CovidCount covidCount) { if (ModelState.IsValid) { db.CovidCount.Add(covidCount); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(covidCount)); }
// GET: CovidCount/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CovidCount covidCount = db.CovidCount.Find(id); if (covidCount == null) { return(HttpNotFound()); } return(View(covidCount)); }