public async Task <IHttpActionResult> PostView_psykopatQuery(View_psykopatQuery view_psykopatQuery) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.View_psykopatQuery.Add(view_psykopatQuery); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (View_psykopatQueryExists(view_psykopatQuery.Room_No)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = view_psykopatQuery.Room_No }, view_psykopatQuery)); }
public async Task <IHttpActionResult> PutView_psykopatQuery(int id, View_psykopatQuery view_psykopatQuery) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != view_psykopatQuery.Room_No) { return(BadRequest()); } db.Entry(view_psykopatQuery).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!View_psykopatQueryExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetView_psykopatQuery(int id) { View_psykopatQuery view_psykopatQuery = await db.View_psykopatQuery.FindAsync(id); if (view_psykopatQuery == null) { return(NotFound()); } return(Ok(view_psykopatQuery)); }
public async Task <IHttpActionResult> DeleteView_psykopatQuery(int id) { View_psykopatQuery view_psykopatQuery = await db.View_psykopatQuery.FindAsync(id); if (view_psykopatQuery == null) { return(NotFound()); } db.View_psykopatQuery.Remove(view_psykopatQuery); await db.SaveChangesAsync(); return(Ok(view_psykopatQuery)); }