Example #1
0
        public async Task <ActionResult <IList <Address> > > AdicionarEndereco([FromRoute] int codigoCliente, [FromBody] AddressInput input)
        {
            try{
                input.Validate();
                if (input.Invalid)
                {
                    return(UnprocessableEntity());
                }

                var result = await clienteService.AddAddress(input, codigoCliente);

                return(Ok(result));
            }catch {
                return(BadRequest());
            }
        }