public IHttpActionResult PutIN_Receiver(int id, IN_Receiver iN_Receiver) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != iN_Receiver.ReceiverID) { return(BadRequest()); } db.Entry(iN_Receiver).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!IN_ReceiverExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetIN_Receiver(int id) { IN_Receiver iN_Receiver = db.IN_Receiver.Find(id); if (iN_Receiver == null) { return(NotFound()); } return(Ok(iN_Receiver)); }
public IHttpActionResult PostIN_Receiver(IN_Receiver iN_Receiver) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.IN_Receiver.Add(iN_Receiver); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = iN_Receiver.ReceiverID }, iN_Receiver)); }
public IHttpActionResult DeleteIN_Receiver(int id) { IN_Receiver iN_Receiver = db.IN_Receiver.Find(id); if (iN_Receiver == null) { return(NotFound()); } db.IN_Receiver.Remove(iN_Receiver); db.SaveChanges(); return(Ok(iN_Receiver)); }