public ActionResult Edit([Bind(Include = "ConditionID,TrailID,Date,ConditionText")] Condition condition) { if (ModelState.IsValid) { db.Entry(condition).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(condition)); }
public async Task <IActionResult> PutTrail(long id, Trail trail) { if (id != trail.Id) { return(BadRequest()); } _context.Entry(trail).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }