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> 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); }