public ActionResult DeleteConfirmed(string id) { crypto crypto = db.cryptoes.Find(id); db.cryptoes.Remove(crypto); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,name,source,timestamp,price,volume_24h,change_7d")] crypto crypto) { if (ModelState.IsValid) { db.Entry(crypto).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(crypto)); }
public ActionResult Create([Bind(Include = "id,name,source,timestamp,price,volume_24h,change_7d")] crypto crypto) { if (ModelState.IsValid) { db.cryptoes.Add(crypto); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(crypto)); }
// GET: crypto/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } crypto crypto = db.cryptoes.Find(id); if (crypto == null) { return(HttpNotFound()); } return(View(crypto)); }