Пример #1
0
        public ActionResult Ekle(HaberTip habertip)
        {
            if (!ModelState.IsValid)
            {
                return View(habertip);
            }

            _haberTipRepository.Insert(habertip);
            _haberTipRepository.Save();

            return RedirectToAction("Index");
        }
Пример #2
0
        public ActionResult Duzenle(HaberTip habertip)
        {
            if (!ModelState.IsValid)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }

            _haberTipRepository.Update(habertip);
            _haberTipRepository.Save();

            return RedirectToAction("Index");
        }
Пример #3
0
 public void Update(HaberTip obj)
 {
     _context.HaberTipleri.AddOrUpdate(obj);
 }
Пример #4
0
 public void Insert(HaberTip obj)
 {
     _context.HaberTipleri.Add(obj);
 }