public async Task <IHttpActionResult> PutGAL_1680(long id, GAL_1680 gAL_1680) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != gAL_1680.cod_event) { return(BadRequest()); } db.Entry(gAL_1680).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GAL_1680Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetGAL_1680(long id) { GAL_1680 gAL_1680 = await db.GAL_1680.FindAsync(id); if (gAL_1680 == null) { return(NotFound()); } return(Ok(gAL_1680)); }
public async Task <IHttpActionResult> PostGAL_1680(GAL_1680 gAL_1680) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.GAL_1680.Add(gAL_1680); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = gAL_1680.cod_event }, gAL_1680)); }
public async Task <IHttpActionResult> DeleteGAL_1680(long id) { GAL_1680 gAL_1680 = await db.GAL_1680.FindAsync(id); if (gAL_1680 == null) { return(NotFound()); } db.GAL_1680.Remove(gAL_1680); await db.SaveChangesAsync(); return(Ok(gAL_1680)); }