public async Task <ActionResult> DeleteConfirmed(string id) { Practics practics = await db.Practics.FindAsync(id); db.Practics.Remove(practics); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "practicsName")] Practics practics) { if (ModelState.IsValid) { db.Entry(practics).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(practics)); }
public async Task <ActionResult> Create([Bind(Include = "practicsName")] Practics practics) { if (ModelState.IsValid) { db.Practics.Add(practics); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(practics)); }
// GET: Practics/Delete/5 public async Task <ActionResult> Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Practics practics = await db.Practics.FindAsync(id); if (practics == null) { return(HttpNotFound()); } return(View(practics)); }