示例#1
0
        private LoanInfo GetLoanInfo()
        {
            string input;
            var    loanDTO = new LoanInfoDTO();

            while (_counter < Buffer.Length)
            {
                input = Buffer[_counter++];
                loanDTO.TryPopulate(input);
            }
            var loan = loanDTO.TryParse(out string[] errors);

            return(loan);
        }
示例#2
0
        private LoanInfo GetLoanInfo()
        {
            string input;
            var    loanDTO = new LoanInfoDTO();

            _view.Write("Please enter loan parameters:");
startInput:
            while (!string.IsNullOrEmpty(input = _view.GetUserInput()))
            {
                loanDTO.TryPopulate(input);
            }
            var loan = loanDTO.TryParse(out string[] errors);

            if (errors != null && errors.Any())
            {
                _view.Write(errors);
                _view.Write("Please correct input parameters.");
                goto startInput;
            }
            return(loan);
        }