public async Task <IHttpActionResult> PutTotales_510(int id, Totales_510 totales_510) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != totales_510.id) { return(BadRequest()); } db.Entry(totales_510).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Totales_510Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetTotales_510(int id) { Totales_510 totales_510 = await db.Totales_510.FindAsync(id); if (totales_510 == null) { return(NotFound()); } return(Ok(totales_510)); }
public async Task <IHttpActionResult> PostTotales_510(Totales_510 totales_510) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Totales_510.Add(totales_510); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = totales_510.id }, totales_510)); }
public async Task <IHttpActionResult> DeleteTotales_510(int id) { Totales_510 totales_510 = await db.Totales_510.FindAsync(id); if (totales_510 == null) { return(NotFound()); } db.Totales_510.Remove(totales_510); await db.SaveChangesAsync(); return(Ok(totales_510)); }