public async Task <IActionResult> PutTODOTask(int id, TODOTask tODOTask) { if (id != tODOTask.Id) { return(BadRequest()); } _context.Entry(tODOTask).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TODOTaskExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutUserDetails(int id, UserDetails userDetails) { if (id != userDetails.Id) { return(BadRequest()); } _context.Entry(userDetails).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserDetailsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Update(TODOItem todo) { using (TODOContext db = new TODOContext()) { db.Todos.Attach(todo); db.Entry(todo).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public ActionResult Edit([Bind(Include = "ListID,Title,Date")] List list) { if (ModelState.IsValid) { db.Entry(list).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(list)); }
public ActionResult Edit([Bind(Include = "ID,title,Image,Date")] TODO1 tODO1) { if (ModelState.IsValid) { db.Entry(tODO1).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tODO1)); }
public ActionResult Edit([Bind(Include = "TaskID,TaskName,Description,IsDone,Date,ListID")] Task task) { if (ModelState.IsValid) { db.Entry(task).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ListID = new SelectList(db.Lists, "ListID", "Title", task.ListID); return(View(task)); }