public IActionResult Post([FromBody] Consumer Consumer) { if (ModelState.IsValid) { service.Save(Consumer); return(Ok(new CreatedAtRouteResult("create Consumer", new { id = Consumer.Id }, Consumer))); } return(BadRequest(ModelState)); }
public IActionResult Post(ConsumerDto consumer) { try { return(Ok(_consumerService.Save(consumer))); } catch (Exception ex) { _logger.LogError(ex.Message); return(BadRequest("Ocorreu uma falha no cadastro de Mesa")); } }