public ActionResult Create(Araba araba) { if (ModelState.IsValid) { db.Araba.Add(araba); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.firmaId = new SelectList(db.Firmalar, "firmaId", "firmaAdi", araba.firmaId); return PartialView(araba); }
public ActionResult Edit(Araba araba) { if (ModelState.IsValid) { db.Entry(araba).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.firmaId = new SelectList(db.Firmalar, "firmaId", "firmaAdi", araba.firmaId); return PartialView(araba); }