예제 #1
0
        public async Task <CreateEmpresaCommandResult> Handle(CreateEmpresaCommand request, CancellationToken cancellationToken)
        {
            var enumeradorUf = (EnumUF)Enum.Parse(typeof(EnumUF), request.UF);
            var empresa      = await _empresaService.CadastrarAsync(new Empresa(enumeradorUf, request.NomeFantasia, request.CNPJ));

            return(new CreateEmpresaCommandResult()
            {
                CNPJ = empresa.CNPJ,
                NomeFantasia = empresa.NomeFantasia,
                UF = empresa.UF
            });
        }