public ActionResult Edit(PUNTOS_ESTIMACION puntos_estimacion) { if (ModelState.IsValid) { puntos_estimacionRepository.InsertOrUpdate(puntos_estimacion); puntos_estimacionRepository.Save(); return RedirectToAction("Index"); } else { return View(); } }
public void InsertOrUpdate(PUNTOS_ESTIMACION puntos_estimacion) { if (puntos_estimacion.ID == default(int)) { // New entity context.PUNTOS_ESTIMACION.Add(puntos_estimacion); } else { // Existing entity context.Entry(puntos_estimacion).State = System.Data.Entity.EntityState.Modified; } }