public async Task <IHttpActionResult> PuttXrefMedicationFormsCode(int id, tXrefMedicationFormsCode tXrefMedicationFormsCode) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tXrefMedicationFormsCode.ID) { return(BadRequest()); } db.Entry(tXrefMedicationFormsCode).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!tXrefMedicationFormsCodeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GettXrefMedicationFormsCode(int id) { tXrefMedicationFormsCode tXrefMedicationFormsCode = await db.tXrefMedicationFormsCodes.FindAsync(id); if (tXrefMedicationFormsCode == null) { return(NotFound()); } return(Ok(tXrefMedicationFormsCode)); }
public async Task <IHttpActionResult> PosttXrefMedicationFormsCode(tXrefMedicationFormsCode tXrefMedicationFormsCode) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tXrefMedicationFormsCodes.Add(tXrefMedicationFormsCode); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = tXrefMedicationFormsCode.ID }, tXrefMedicationFormsCode)); }
public async Task <IHttpActionResult> DeletetXrefMedicationFormsCode(int id) { tXrefMedicationFormsCode tXrefMedicationFormsCode = await db.tXrefMedicationFormsCodes.FindAsync(id); if (tXrefMedicationFormsCode == null) { return(NotFound()); } db.tXrefMedicationFormsCodes.Remove(tXrefMedicationFormsCode); await db.SaveChangesAsync(); return(Ok(tXrefMedicationFormsCode)); }