public int CalculateValue(GlobalEnums.OperatorsEnum operatorsEnum, int firstValue, int secondValue) { int result = _serviceAccessor(operatorsEnum).PerformOperation(firstValue, secondValue); _iCalculatorRepository.Calculate(operatorsEnum, result); return(result); }
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()); } }
public int Get(GlobalEnums.OperatorsEnum operatorsEnum, int firstValue, int secondValue) { return(_iCalculatorService.CalculateValue(operatorsEnum, firstValue, secondValue)); }