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