public async Task <IHttpActionResult> PutGuias_503(int id, Guias_503 guias_503) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != guias_503.id) { return(BadRequest()); } db.Entry(guias_503).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Guias_503Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetGuias_503(int id) { Guias_503 guias_503 = await db.Guias_503.FindAsync(id); if (guias_503 == null) { return(NotFound()); } return(Ok(guias_503)); }
public async Task <IHttpActionResult> PostGuias_503(Guias_503 guias_503) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Guias_503.Add(guias_503); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = guias_503.id }, guias_503)); }
public async Task <IHttpActionResult> DeleteGuias_503(int id) { Guias_503 guias_503 = await db.Guias_503.FindAsync(id); if (guias_503 == null) { return(NotFound()); } db.Guias_503.Remove(guias_503); await db.SaveChangesAsync(); return(Ok(guias_503)); }