public async Task <IActionResult> Post([FromBody] RegisterCustomerCommand command)
        {
            var result = _handler.Handle(command);

            if (!_handler.IsValid())
            {
                return(BadRequest(new { success = false, errors = _handler.Notifications }));
            }

            return(Ok(result));
        }
Ejemplo n.º 2
0
        public IActionResult Post([FromBody] RegisterCustomerCommand command)
        {
            var result = _commandHandler.Handle(command);

            if (_commandHandler.IsValid())
            {
                return(Ok(result));
            }

            else
            {
                return(BadRequest(_commandHandler.Notifications));
            }
        }