public async Task <ActionResult> DeleteConfirmed(int id) { LibarayShelfCat libarayShelfCat = await db.LibarayShelfCat.FindAsync(id); db.LibarayShelfCat.Remove(libarayShelfCat); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,ShelfName,Description")] LibarayShelfCat libarayShelfCat) { if (ModelState.IsValid) { db.Entry(libarayShelfCat).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(libarayShelfCat)); }
public async Task <ActionResult> Create([Bind(Include = "Id,ShelfName,Description")] LibarayShelfCat libarayShelfCat) { if (ModelState.IsValid) { db.LibarayShelfCat.Add(libarayShelfCat); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(libarayShelfCat)); }
// GET: LibarayShelfCats/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LibarayShelfCat libarayShelfCat = await db.LibarayShelfCat.FindAsync(id); if (libarayShelfCat == null) { return(HttpNotFound()); } return(View(libarayShelfCat)); }