public async Task <IHttpActionResult> PutGC_Perfil(int id, GC_Perfil gC_Perfil) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != gC_Perfil.Id) { return(BadRequest()); } db.Entry(gC_Perfil).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GC_PerfilExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetGC_Perfil(int id) { GC_Perfil gC_Perfil = await db.GC_Perfil.FindAsync(id); if (gC_Perfil == null) { return(NotFound()); } return(Ok(gC_Perfil)); }
public async Task <IHttpActionResult> PostGC_Perfil(GC_Perfil gC_Perfil) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.GC_Perfil.Add(gC_Perfil); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = gC_Perfil.Id }, gC_Perfil)); }
public async Task <IHttpActionResult> DeleteGC_Perfil(int id) { GC_Perfil gC_Perfil = await db.GC_Perfil.FindAsync(id); if (gC_Perfil == null) { return(NotFound()); } db.GC_Perfil.Remove(gC_Perfil); await db.SaveChangesAsync(); return(Ok(gC_Perfil)); }