Exemplo n.º 1
0
        public override (ConcreteLoanResult, string) GetInfo(string source)
        {
            var(result, input) = GetLoanInput(source);
            if (result != ConcreteLoanResult.Ok)
            {
                return(result, null);
            }

            if (!IsDataCorrect(input))
            {
                return(ConcreteLoanResult.InvalidData, null);
            }

            concreteLoanOutput = GetLoanOutput(input);
            return(ConcreteLoanResult.Ok, GetJsonStringOfOutput(concreteLoanOutput));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Get a  json representation of LoanOutput
 /// </summary>
 /// <param name="concreteLoanOutput"></param>
 /// <returns></returns>
 private string GetJsonStringOfOutput(ConcreteLoanOutput concreteLoanOutput) => JsonConvert.SerializeObject(concreteLoanOutput);