示例#1
0
        public Result CriarConta(CriarContaCommand command)
        {
            try
            {
                var result = command.Validate();

                if (result.IsFailure)
                {
                    return(result);
                }

                _repository.AdicionarConta(result.Value);

                return(Result.Ok());
            }
            catch (Exception ex)
            {
                return(Result.Fail("Falha ao criar conta"));
            }
        }