Ejemplo n.º 1
0
        public ActionResult Put([FromBody] AgendamentoManutencao agendamento)
        {
            try
            {
                var agendamentoUpdate = _cyrellaDbContext.Attach(agendamento);
                agendamentoUpdate.State = EntityState.Modified;

                _cyrellaDbContext.SaveChanges();
                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Ejemplo n.º 2
0
        public ActionResult Post([FromBody] AgendamentoManutencao agendamento)
        {
            try
            {
                _cyrellaDbContext.Add(agendamento);
                _cyrellaDbContext.SaveChanges();

                return(Created("", agendamento));
            }
            catch (Exception)
            {
                return(BadRequest());

                throw;
            }
        }