コード例 #1
0
 public void InsertOrUpdate(SPRINT sprint)
 {
     if (sprint.ID == default(int)) {
         // New entity
         context.SPRINT.Add(sprint);
     } else {
         // Existing entity
         context.Entry(sprint).State = System.Data.Entity.EntityState.Modified;
     }
 }
コード例 #2
0
        public ActionResult Edit(SPRINT sprint)
        {
            if (ModelState.IsValid) {
                sprintRepository.InsertOrUpdate(sprint);
                sprintRepository.Save();
                return RedirectToAction("Index");
            } else {
				return View();
			}
        }