public IHttpActionResult PutLogsT(int id, LogsT logsT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != logsT.id_log) { return(BadRequest()); } db.Entry(logsT).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!LogsTExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetLogsT(int id) { LogsT logsT = db.LogsT.Find(id); if (logsT == null) { return(NotFound()); } return(Ok(logsT)); }
public IHttpActionResult PostLogsT(LogsT logsT) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LogsT.Add(logsT); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = logsT.id_log }, logsT)); }
public IHttpActionResult DeleteLogsT(int id) { LogsT logsT = db.LogsT.Find(id); if (logsT == null) { return(NotFound()); } db.LogsT.Remove(logsT); db.SaveChanges(); return(Ok(logsT)); }