public ActionResult <Agendamentos> PostAmbientes(Agendamentos agendamento) { try { _agendamentoService.Cadastrar(agendamento); return(CreatedAtAction("GetAgendamentos", new { id = agendamento.AgendamentoId }, agendamento)); } catch (Exception) { return(BadRequest()); } }
public void Cadastrar(CadastroViewModel cadastroViewModel) { var agendamento = mapper.Map <Agendamento>(cadastroViewModel); agendamentoService.Cadastrar(agendamento); }