示例#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);
 }