예제 #1
0
 public void InsertOrUpdate(Log4Net log4Net)
 {
     if (log4Net.ID == default(int)) {
         // New entity
         _context.Log4Net.Add(log4Net);
     } else {
         // Existing entity
         _context.Entry(log4Net).State = EntityState.Modified;
     }
 }
예제 #2
0
 public ActionResult Create(Log4Net log4net)
 {
     if (!ModelState.IsValid)
     {
         return View();
     }
     _log4NetRepository.InsertOrUpdate(log4net);
     _log4NetRepository.Save();
     return RedirectToAction("Index");
 }