public async Task <IActionResult> PutTB_USER([FromRoute] string id, [FromBody] TB_USER tB_USER) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tB_USER.UserId) { return(BadRequest()); } _context.Entry(tB_USER).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TB_USERExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public IHttpActionResult PutReviews(int id, Reviews reviews) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != reviews.ID) { return(BadRequest()); } db.Entry(reviews).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ReviewsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Edit([Bind(Include = "ID,CategoryName")] Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public ActionResult Edit([Bind(Include = "ID,PostTitle,Image,CategoryID")] Post post) { if (ModelState.IsValid) { post.DateAdded = DateTime.Now; db.Entry(post).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(post)); }
public ActionResult Edit([Bind(Include = "CategoryID,Created,Modified,CategoryName,Description")] Category category) { if (ModelState.IsValid) { category.Modified = DateTime.UtcNow.Ticks; db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(category)); }
public bool Edit(CustomerProfile obj) { spc.Entry <CustomerProfile>(obj).State = System.Data.Entity.EntityState.Modified; spc.CustomerProfiles.Attach(obj); return(true); }
public bool Edit(CustomerLogin obj) { spc.Entry <CustomerLogin>(obj).State = System.Data.Entity.EntityState.Modified; return(true); }
public bool Edit(Token obj) { spc.Entry <Token>(obj).State = System.Data.Entity.EntityState.Modified; return(true); }
public bool Edit(Product obj) { spc.Entry <Product>(obj).State = System.Data.Entity.EntityState.Modified; return(true); }