public async Task <IHttpActionResult> PutLive_Meeting(int id, Live_Meeting live_Meeting) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != live_Meeting.IdLive_Meeting) { return(BadRequest()); } db.Entry(live_Meeting).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Live_MeetingExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetLive_Meeting(int id) { Live_Meeting live_Meeting = await db.Live_Meeting.FindAsync(id); if (live_Meeting == null) { return(NotFound()); } return(Ok(live_Meeting)); }
public async Task <IHttpActionResult> PostLive_Meeting(Live_Meeting live_Meeting) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Live_Meeting.Add(live_Meeting); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = live_Meeting.IdLive_Meeting }, live_Meeting)); }
public async Task <IHttpActionResult> DeleteLive_Meeting(int id) { Live_Meeting live_Meeting = await db.Live_Meeting.FindAsync(id); if (live_Meeting == null) { return(NotFound()); } db.Live_Meeting.Remove(live_Meeting); await db.SaveChangesAsync(); return(Ok(live_Meeting)); }