public async Task <IHttpActionResult> PutTL_EventLog(long id, TL_EventLog tL_EventLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tL_EventLog.ID) { return(BadRequest()); } db.Entry(tL_EventLog).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TL_EventLogExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetTL_EventLog(long id) { TL_EventLog tL_EventLog = await db.TL_EventLog.FindAsync(id); if (tL_EventLog == null) { return(NotFound()); } return(Ok(tL_EventLog)); }
public async Task <IHttpActionResult> PostTL_EventLog(TL_EventLog tL_EventLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.TL_EventLog.Add(tL_EventLog); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = tL_EventLog.ID }, tL_EventLog)); }
public async Task <IHttpActionResult> DeleteTL_EventLog(long id) { TL_EventLog tL_EventLog = await db.TL_EventLog.FindAsync(id); if (tL_EventLog == null) { return(NotFound()); } db.TL_EventLog.Remove(tL_EventLog); await db.SaveChangesAsync(); return(Ok(tL_EventLog)); }