コード例 #1
0
 public ActionResult Edit(Category category)
 {
     _db.Entry(category).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #2
0
 public Item Edit(Item item)
 {
     db.Entry(item).State = EntityState.Modified;
     db.SaveChanges();
     return(item);
 }
コード例 #3
0
 public ActionResult Edit(Item item, int CategoryId)
 {
     _db.Entry(item).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #4
0
 public ActionResult Edit(Item item)               // updates the item after being routed to there by Get method
 {
     _db.Entry(item).State = EntityState.Modified; // (item) = routing parameter // Entry () = method, State = property // state updated to EntityState.Modified = tells Entity the entry has been updated
     _db.SaveChanges();                            // once state has been modified, we call SaveChanges
     return(RedirectToAction("Index"));
 }
コード例 #5
0
 public IActionResult Edit(Item item)
 {
     db.Entry(item).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #6
0
 public ActionResult Edit(Experience Experience)
 {
     db.Entry(Experience).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #7
0
 public void Update(Classification classification)
 {
     db.Entry(classification).State = EntityState.Modified;
     db.SaveChanges();
 }
コード例 #8
0
 public void UpdateLabel(Label label)
 {
     _db.Entry(label).State = EntityState.Modified;
     Save();
 }
コード例 #9
0
 public IActionResult Edit(Item item)
 {
     db.Entry(item).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #10
0
 public void Update(Item item)
 {
     _db.Entry(item).State = EntityState.Modified;
     _db.SaveChanges();
 }