public ActionResult Insert([FromBody] CustomerDTO customerDTO) { if (!ModelState.IsValid) { return(NotFound()); } applicationServiceCustomer.Insert(customerDTO); return(Ok("Customer successfully registered!")); }
public ActionResult <CustomerDTO> Post([FromBody] CustomerDTO customerDTO) { try { return(_customerApplicationService.Insert(customerDTO)); } catch (Exception ex) { return(BadRequest(new { ex.Message })); } }