public async Task <IHttpActionResult> PutPropostaSubmetida(int id, PropostaSubmetida propostaSubmetida) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != propostaSubmetida.id_proposta_submetida) { return(BadRequest()); } db.Entry(propostaSubmetida).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PropostaSubmetidaExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetPropostaSubmetida(int id) { PropostaSubmetida propostaSubmetida = await db.PropostaSubmetida.FindAsync(id); if (propostaSubmetida == null) { return(NotFound()); } return(Ok(propostaSubmetida)); }
public async Task <IHttpActionResult> PostPropostaSubmetida(PropostaSubmetida propostaSubmetida) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PropostaSubmetida.Add(propostaSubmetida); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = propostaSubmetida.id_proposta_submetida }, propostaSubmetida)); }
public async Task <IHttpActionResult> DeletePropostaSubmetida(int id) { PropostaSubmetida propostaSubmetida = await db.PropostaSubmetida.FindAsync(id); if (propostaSubmetida == null) { return(NotFound()); } db.PropostaSubmetida.Remove(propostaSubmetida); await db.SaveChangesAsync(); return(Ok(propostaSubmetida)); }