public ActionResult Put([FromBody] AgendamentoManutencao agendamento) { try { var agendamentoUpdate = _cyrellaDbContext.Attach(agendamento); agendamentoUpdate.State = EntityState.Modified; _cyrellaDbContext.SaveChanges(); return(Ok()); } catch (Exception) { return(BadRequest()); } }
public ActionResult Post([FromBody] AgendamentoManutencao agendamento) { try { _cyrellaDbContext.Add(agendamento); _cyrellaDbContext.SaveChanges(); return(Created("", agendamento)); } catch (Exception) { return(BadRequest()); throw; } }