コード例 #1
0
        public async Task <bool> Criar(ClienteViewModel clienteViewModel)
        {
            var cliente   = clienteViewModel.MapToEntity();
            var clienteId = await _clienteRepository.AddAsync(cliente);

            if (clienteId <= 0)
            {
                return(false);
            }

            await _contatoService.Criar(clienteViewModel.Contatos, clienteId);

            return(true);
        }