public async Task <ActionResult> DeleteConfirmed(int id) { Vehicletbl vehicletbl = await db.Vehicletbls.FindAsync(id); db.Vehicletbls.Remove(vehicletbl); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID,Name,Displayname,Make,VehicleType,FuelType,VehicleMass,EngineCapacity_cc_,MaxSpeed,MaxPower,OnRoadPrice,Description")] Vehicletbl vehicletbl) { if (ModelState.IsValid) { db.Entry(vehicletbl).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(vehicletbl)); }
// GET: Vehicletbls/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Vehicletbl vehicletbl = await db.Vehicletbls.FindAsync(id); if (vehicletbl == null) { return(HttpNotFound()); } return(View(vehicletbl)); }