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