public ActionResult DeleteConfirmed(int id) { RestSharpTable restSharpTable = db.RestSharpTables.Find(id); db.RestSharpTables.Remove(restSharpTable); db.SaveChanges(); return(RedirectToAction("Index")); }
public async Task <ActionResult> DeleteConfirmed(int id) { RestSharpTable restSharpTable = await db.RestSharpTables.FindAsync(id); db.RestSharpTables.Remove(restSharpTable); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,TimeScraped,Symbol,LastPrice,Change,ChangePercent")] RestSharpTable restSharpTable) { if (ModelState.IsValid) { db.Entry(restSharpTable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(restSharpTable)); }
public ActionResult Create([Bind(Include = "Id,TimeScraped,Symbol,LastPrice,Change,ChangePercent")] RestSharpTable restSharpTable) { if (ModelState.IsValid) { db.RestSharpTables.Add(restSharpTable); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(restSharpTable)); }
// GET: RestSharpTables/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RestSharpTable restSharpTable = await db.RestSharpTables.FindAsync(id); if (restSharpTable == null) { return(HttpNotFound()); } return(View(restSharpTable)); }
// GET: RestSharpTables/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RestSharpTable restSharpTable = db.RestSharpTables.Find(id); if (restSharpTable == null) { return(HttpNotFound()); } return(View(restSharpTable)); }