コード例 #1
0
        public CalcResponse ExecuteBinaryOperation(BinaryCalcRequest request)
        {
            var command1 = CreateCommand(CommandType.Add, request.Operand1);
            var command2 = CreateCommand(request.CommandType, request.Operand2);

            return(new CalcResponse()
            {
                Result = Run(new Command[] { command1, command2 })
            });
        }
コード例 #2
0
 public IActionResult BinaryOperation([FromQuery] BinaryCalcRequest request)
 {
     return(Ok(_pangoCalculator.ExecuteBinaryOperation(request)));
 }