public IHttpActionResult Posttodo_sts(todo_sts todo_sts) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.todo_sts.Add(todo_sts); try { db.SaveChanges(); } catch (DbUpdateException) { if (todo_stsExists(todo_sts.st_cd)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = todo_sts.st_cd }, todo_sts)); }
public IHttpActionResult Puttodo_sts(int id, todo_sts todo_sts) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != todo_sts.st_cd) { return(BadRequest()); } db.Entry(todo_sts).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!todo_stsExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Gettodo_sts(int id) { todo_sts todo_sts = db.todo_sts.Find(id); if (todo_sts == null) { return(NotFound()); } return(Ok(todo_sts)); }
public IHttpActionResult Deletetodo_sts(int id) { todo_sts todo_sts = db.todo_sts.Find(id); if (todo_sts == null) { return(NotFound()); } db.todo_sts.Remove(todo_sts); db.SaveChanges(); return(Ok(todo_sts)); }