public ActionResult Ekle(HaberTip habertip) { if (!ModelState.IsValid) { return View(habertip); } _haberTipRepository.Insert(habertip); _haberTipRepository.Save(); return RedirectToAction("Index"); }
public ActionResult Duzenle(HaberTip habertip) { if (!ModelState.IsValid) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } _haberTipRepository.Update(habertip); _haberTipRepository.Save(); return RedirectToAction("Index"); }
public void Update(HaberTip obj) { _context.HaberTipleri.AddOrUpdate(obj); }
public void Insert(HaberTip obj) { _context.HaberTipleri.Add(obj); }