public IHttpActionResult PutA1Data(int id, A1Data a1Data) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != a1Data.Id) { return(BadRequest()); } db.Entry(a1Data).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!A1DataExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetA1Data(int id) { A1Data a1Data = db.A1Data.Find(id); if (a1Data == null) { return(NotFound()); } return(Ok(a1Data)); }
public IHttpActionResult PostA1Data(A1Data a1Data) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.A1Data.Add(a1Data); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = a1Data.Id }, a1Data)); }
public IHttpActionResult DeleteA1Data(int id) { A1Data a1Data = db.A1Data.Find(id); if (a1Data == null) { return(NotFound()); } db.A1Data.Remove(a1Data); db.SaveChanges(); return(Ok(a1Data)); }