Beispiel #1
0
        public int DoMathUsingPost(MathRequest mathRequest)
        {
            switch (mathRequest.Operation)
            {
            case "+":
                return(mathRequest.Num1 + mathRequest.Num2);

            default:
                return(0);
            }
        }
Beispiel #2
0
        public int Get(MathRequest mathRequest)
        {
            switch (mathRequest.Operation)
            {
            case "+":
                var answer = mathRequest.Num1 + mathRequest.Num2;
                _logger.LogDebug($"added {mathRequest.Num1} and {mathRequest.Num2} to get {answer}");
                return(answer);

            default:
                return(0);
            }
        }