public async Task <IHttpActionResult> PutConveningforScreening(int id, ConveningforScreening conveningforScreening) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != conveningforScreening.Id) { return(BadRequest()); } db.Entry(conveningforScreening).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConveningforScreeningExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetConveningforScreening(int id) { ConveningforScreening conveningforScreening = await db.ConveningforScreenings.FindAsync(id); if (conveningforScreening == null) { return(NotFound()); } return(Ok(conveningforScreening)); }
public async Task <IHttpActionResult> PostConveningforScreening(ConveningforScreening conveningforScreening) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ConveningforScreenings.Add(conveningforScreening); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = conveningforScreening.Id }, conveningforScreening)); }
public async Task <IHttpActionResult> DeleteConveningforScreening(int id) { ConveningforScreening conveningforScreening = await db.ConveningforScreenings.FindAsync(id); if (conveningforScreening == null) { return(NotFound()); } db.ConveningforScreenings.Remove(conveningforScreening); await db.SaveChangesAsync(); return(Ok(conveningforScreening)); }