Пример #1
0
        public int CalculateValue(GlobalEnums.OperatorsEnum operatorsEnum, int firstValue, int secondValue)
        {
            int result = _serviceAccessor(operatorsEnum).PerformOperation(firstValue, secondValue);

            _iCalculatorRepository.Calculate(operatorsEnum, result);
            return(result);
        }
Пример #2
0
        public int Calculate(GlobalEnums.OperatorsEnum operatorValue, int resultValue)
        {
            DynamicParameters parameters = new DynamicParameters();

            parameters.Add("@operator", operatorValue, DbType.Int32);
            parameters.Add("@result", resultValue, DbType.Int32);
            using (SqlConnection con = _connectionManager.GetConnection())
            {
                con.Open();
                var result = con.Query <int>("uspStoreCalculatorResult", param: parameters, commandType: CommandType.StoredProcedure);
                return(result.FirstOrDefault());
            }
        }
Пример #3
0
 public int Get(GlobalEnums.OperatorsEnum operatorsEnum, int firstValue, int secondValue)
 {
     return(_iCalculatorService.CalculateValue(operatorsEnum, firstValue, secondValue));
 }