public ActionResult Edit([Bind(Include = "Id,Fordontyp,Färg,Regnr,Märke,Modell,Ägare,Parkerad")] FordonModel fordonModel) { if (ModelState.IsValid) { db.Edit(fordonModel); return(RedirectToAction("Index")); } return(View(fordonModel)); }
// GET: FordonModels/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FordonModel fordonModel = db.Find(id); if (fordonModel == null) { return(HttpNotFound()); } return(View(fordonModel)); }
public void Edit(FordonModel fordon) { this.Entry(fordon).State = EntityState.Modified; this.SaveChanges(); }
public FordonModel Find(FordonModel fordon) { return(Fordon.Find(fordon.Id)); }
public void Remove(FordonModel fordon) { this.Remove(fordon); }
public void Add(FordonModel fordon) { Fordon.Add(fordon); this.SaveChanges(); }