Exemplo n.º 1
0
        public async Task <Response.Cliente> Add(Request.Cliente entity)
        {
            if (!IsParameterValid(entity))
            {
                throw new InvalidParametersException <IClienteAppService>();
            }

            var cliente = await clienteRepository.Add(entity.ConvertToData());

            await Salvar();

            return(new Response.Cliente());
        }
Exemplo n.º 2
0
 public async Task <ActionResult> Update([FromBody] Requests.Cliente cliente)
 {
     return(Ok(await clienteAppService.Update(cliente, cliente.Id)));
 }
Exemplo n.º 3
0
 public async Task <ActionResult> Add([FromBody] Requests.Cliente cliente)
 {
     return(Ok(await clienteAppService.Add(cliente)));
 }