public async Task <IHttpActionResult> PutResumo_pesquisa(long id, Resumocs resumocs) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != resumocs.id) { return(BadRequest()); } db.Entry(resumocs).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Resumo_pesquisaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetResumo_pesquisa(long id) { Resumocs resumocs = await db.Resumocs.FindAsync(id); if (resumocs == null) { return(NotFound()); } return(Ok(resumocs)); }
public async Task <IHttpActionResult> PostResumo_pesquisa(Resumocs resumocs) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Resumocs.Add(resumocs); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = resumocs.id }, resumocs)); }
public async Task <IHttpActionResult> DeleteResumo_pesquisa(long id) { Resumocs resumocs = await db.Resumocs.FindAsync(id); if (resumocs == null) { return(NotFound()); } db.Resumocs.Remove(resumocs); await db.SaveChangesAsync(); return(Ok(resumocs)); }