public IHttpActionResult Putcallau(int id, callau callau) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != callau.CallauID) { return(BadRequest()); } db.Entry(callau).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!callauExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Getcallau(int id) { callau callau = db.callaus.Find(id); if (callau == null) { return(NotFound()); } return(Ok(callau)); }
public IHttpActionResult Postcallau(callau callau) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.callaus.Add(callau); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = callau.CallauID }, callau)); }
public IHttpActionResult Deletecallau(int id) { callau callau = db.callaus.Find(id); if (callau == null) { return(NotFound()); } db.callaus.Remove(callau); db.SaveChanges(); return(Ok(callau)); }