Exemple #1
0
        public async Task <CalculateResponse> Calculate(MathOperation operation)
        {
            if (operation.Operator == null)
            {
                throw new ArgumentNullException(nameof(operation.Operator));
            }

            OperationRequest request = new OperationRequest
            {
                A        = operation.LeftOperand,
                B        = operation.RightOperand,
                Operator = OperatorTypeMapping[(Operators)operation.Operator]
            };

            return(await _client.CalculateAsync(request));
        }